MCPcopy Create free account
hub / github.com/buke/quickjs-go / JS_NewCustomContext

Function JS_NewCustomContext

deps/quickjs/run-test262.c:1722–1737  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1720 JS_OBJECT_DEF("qjs", qjs_methods, countof(qjs_methods), JS_PROP_C_W_E);
1721
1722JSContext *JS_NewCustomContext(JSRuntime *rt)
1723{
1724 JSContext *ctx;
1725 JSValue obj;
1726
1727 ctx = JS_NewContext(rt);
1728 if (ctx && local) {
1729 js_init_module_std(ctx, "qjs:std");
1730 js_init_module_os(ctx, "qjs:os");
1731 js_init_module_bjson(ctx, "qjs:bjson");
1732 obj = JS_GetGlobalObject(ctx);
1733 JS_SetPropertyFunctionList(ctx, obj, &qjs_object, 1);
1734 JS_FreeValue(ctx, obj);
1735 }
1736 return ctx;
1737}
1738
1739int run_test_buf(ThreadLocalStorage *tls, const char *filename, char *harness,
1740 namelist_t *ip, char *buf, size_t buf_len,

Callers 1

run_test_bufFunction · 0.70

Calls 3

js_init_module_stdFunction · 0.85
js_init_module_osFunction · 0.85
js_init_module_bjsonFunction · 0.85

Tested by

no test coverage detected