diff options
author | bellard <6490144+bellard@users.noreply.github.com> | 2020-11-08 14:30:56 +0100 |
---|---|---|
committer | bellard <6490144+bellard@users.noreply.github.com> | 2020-11-08 14:30:56 +0100 |
commit | b1f67dfc1a7372dd665246cf1c203528e5057e42 (patch) | |
tree | b68346b1d20aa2e709c44a4f7ea902dd3ba6336f /quickjs.h | |
parent | 7c312df422572cf867f29a1d80693e8a77f7fb2a (diff) | |
download | quickjs-b1f67dfc1a7372dd665246cf1c203528e5057e42.tar.gz quickjs-b1f67dfc1a7372dd665246cf1c203528e5057e42.zip |
2020-11-08 release
Diffstat (limited to 'quickjs.h')
-rw-r--r-- | quickjs.h | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -776,7 +776,10 @@ JS_BOOL JS_DetectModule(const char *input, size_t input_len); /* 'input' must be zero terminated i.e. input[input_len] = '\0'. */ JSValue JS_Eval(JSContext *ctx, const char *input, size_t input_len, const char *filename, int eval_flags); -JSValue JS_EvalFunction(JSContext *ctx, JSValue fun_obj); +/* same as JS_Eval() but with an explicit 'this_obj' parameter */ +JSValue JS_EvalThis(JSContext *ctx, JSValueConst this_obj, + const char *input, size_t input_len, + const char *filename, int eval_flags); JSValue JS_GetGlobalObject(JSContext *ctx); int JS_IsInstanceOf(JSContext *ctx, JSValueConst val, JSValueConst obj); int JS_DefineProperty(JSContext *ctx, JSValueConst this_obj, @@ -885,7 +888,9 @@ uint8_t *JS_WriteObject2(JSContext *ctx, size_t *psize, JSValueConst obj, #define JS_READ_OBJ_REFERENCE (1 << 3) /* allow object references */ JSValue JS_ReadObject(JSContext *ctx, const uint8_t *buf, size_t buf_len, int flags); - +/* instantiate and evaluate a bytecode function. Only used when + reading a script or module with JS_ReadObject() */ +JSValue JS_EvalFunction(JSContext *ctx, JSValue fun_obj); /* load the dependencies of the module 'obj'. Useful when JS_ReadObject() returns a module. */ int JS_ResolveModule(JSContext *ctx, JSValueConst obj); |