Skip to content

Commit afeeebf

Browse files
authored
Expose ctx->function_proto
1 parent 36227a5 commit afeeebf

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

quickjs.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2319,6 +2319,11 @@ JSValue JS_GetClassProto(JSContext *ctx, JSClassID class_id)
23192319
return js_dup(ctx->class_proto[class_id]);
23202320
}
23212321

2322+
JSValue JS_GetFunctionProto(JSContext *ctx)
2323+
{
2324+
return js_dup(ctx->function_proto);
2325+
}
2326+
23222327
typedef enum JSFreeModuleEnum {
23232328
JS_FREE_MODULE_ALL,
23242329
JS_FREE_MODULE_NOT_RESOLVED,

quickjs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ JS_EXTERN void JS_SetContextOpaque(JSContext *ctx, void *opaque);
326326
JS_EXTERN JSRuntime *JS_GetRuntime(JSContext *ctx);
327327
JS_EXTERN void JS_SetClassProto(JSContext *ctx, JSClassID class_id, JSValue obj);
328328
JS_EXTERN JSValue JS_GetClassProto(JSContext *ctx, JSClassID class_id);
329+
JS_EXTERN JSValue JS_GetFunctionProto(JSContext *ctx);
329330

330331
/* the following functions are used to select the intrinsic object to
331332
save memory */

0 commit comments

Comments
 (0)