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

Function main

deps/quickjs/gen/function_source.c:60–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60int main(int argc, char **argv)
61{
62 int r;
63 JSRuntime *rt;
64 JSContext *ctx;
65 r = 0;
66 rt = JS_NewRuntime();
67 js_std_set_worker_new_context_func(JS_NewCustomContext);
68 js_std_init_handlers(rt);
69 JS_SetModuleLoaderFunc2(rt, NULL, js_module_loader, js_module_check_attributes, NULL);
70 ctx = JS_NewCustomContext(rt);
71 js_std_add_helpers(ctx, argc, argv);
72 js_std_eval_binary(ctx, qjsc_function_source, qjsc_function_source_size, 0);
73 r = js_std_loop(ctx);
74 if (r) {
75 js_std_dump_error(ctx);
76 }
77 js_std_free_handlers(rt);
78 JS_FreeContext(ctx);
79 JS_FreeRuntime(rt);
80 return r;
81}

Callers

nothing calls this directly

Calls 8

js_std_init_handlersFunction · 0.85
js_std_add_helpersFunction · 0.85
js_std_eval_binaryFunction · 0.85
js_std_loopFunction · 0.85
js_std_dump_errorFunction · 0.85
js_std_free_handlersFunction · 0.85
JS_NewCustomContextFunction · 0.70

Tested by

no test coverage detected