From afeeebf89e2d0f34b459bc6fb3683ef54ed8ab0e Mon Sep 17 00:00:00 2001 From: Richard Davison Date: Wed, 16 Oct 2024 20:39:09 +0200 Subject: [PATCH] Expose ctx->function_proto --- quickjs.c | 5 +++++ quickjs.h | 1 + 2 files changed, 6 insertions(+) diff --git a/quickjs.c b/quickjs.c index 401c48a5..3642aea1 100644 --- a/quickjs.c +++ b/quickjs.c @@ -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, diff --git a/quickjs.h b/quickjs.h index f7ce019a..e95d2241 100644 --- a/quickjs.h +++ b/quickjs.h @@ -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 */