Expose ctx->function_proto

This commit is contained in:
Richard Davison 2024-10-16 20:39:09 +02:00 committed by GitHub
parent 36227a5310
commit afeeebf89e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View file

@ -2319,6 +2319,11 @@ JSValue JS_GetClassProto(JSContext *ctx, JSClassID class_id)
return js_dup(ctx->class_proto[class_id]);
}
JSValue JS_GetFunctionProto(JSContext *ctx)
{
return js_dup(ctx->function_proto);
}
typedef enum JSFreeModuleEnum {
JS_FREE_MODULE_ALL,
JS_FREE_MODULE_NOT_RESOLVED,

View file

@ -326,6 +326,7 @@ JS_EXTERN void JS_SetContextOpaque(JSContext *ctx, void *opaque);
JS_EXTERN JSRuntime *JS_GetRuntime(JSContext *ctx);
JS_EXTERN void JS_SetClassProto(JSContext *ctx, JSClassID class_id, JSValue obj);
JS_EXTERN JSValue JS_GetClassProto(JSContext *ctx, JSClassID class_id);
JS_EXTERN JSValue JS_GetFunctionProto(JSContext *ctx);
/* the following functions are used to select the intrinsic object to
save memory */