diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2025-04-26 12:25:42 +0200 |
---|---|---|
committer | Fabrice Bellard <fabrice@bellard.org> | 2025-04-26 12:25:42 +0200 |
commit | 1b13fa6450ac040e4b171291280f87f169c1c6ad (patch) | |
tree | 3b9a1333166b0f89e6a99fd756165bb77e2468b6 /quickjs.h | |
parent | 7645ce5f632b34b228f39bb9868801d484d76791 (diff) | |
download | quickjs-1b13fa6450ac040e4b171291280f87f169c1c6ad.tar.gz quickjs-1b13fa6450ac040e4b171291280f87f169c1c6ad.zip |
added more C callbacks for exotic objects (#324)
Diffstat (limited to 'quickjs.h')
-rw-r--r-- | quickjs.h | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -501,6 +501,17 @@ typedef struct JSClassExoticMethods { /* return < 0 if exception or TRUE/FALSE */ int (*set_property)(JSContext *ctx, JSValueConst obj, JSAtom atom, JSValueConst value, JSValueConst receiver, int flags); + + /* To get a consistent object behavior when get_prototype != NULL, + get_property, set_property and set_prototype must be != NULL + and the object must be created with a JS_NULL prototype. */ + JSValue (*get_prototype)(JSContext *ctx, JSValueConst obj); + /* return < 0 if exception or TRUE/FALSE */ + int (*set_prototype)(JSContext *ctx, JSValueConst obj, JSValueConst proto_val); + /* return < 0 if exception or TRUE/FALSE */ + int (*is_extensible)(JSContext *ctx, JSValueConst obj); + /* return < 0 if exception or TRUE/FALSE */ + int (*prevent_extensions)(JSContext *ctx, JSValueConst obj); } JSClassExoticMethods; typedef void JSClassFinalizer(JSRuntime *rt, JSValue val); |