summaryrefslogtreecommitdiff
path: root/quickjs.h
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2025-04-26 12:25:42 +0200
committerFabrice Bellard <fabrice@bellard.org>2025-04-26 12:25:42 +0200
commit1b13fa6450ac040e4b171291280f87f169c1c6ad (patch)
tree3b9a1333166b0f89e6a99fd756165bb77e2468b6 /quickjs.h
parent7645ce5f632b34b228f39bb9868801d484d76791 (diff)
downloadquickjs-1b13fa6450ac040e4b171291280f87f169c1c6ad.tar.gz
quickjs-1b13fa6450ac040e4b171291280f87f169c1c6ad.zip
added more C callbacks for exotic objects (#324)
Diffstat (limited to 'quickjs.h')
-rw-r--r--quickjs.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/quickjs.h b/quickjs.h
index a75d990..8814222 100644
--- a/quickjs.h
+++ b/quickjs.h
@@ -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);