MCPcopy Create free account
hub / github.com/Snapchat/Valdi / tsn_init

Function tsn_init

tsn/src/tsn/tsn.cpp:1289–1305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1287}
1288
1289tsn_vm* tsn_init(int /*argc*/, const char** /*argv*/) {
1290 auto* runtime = JS_NewRuntime();
1291 if (runtime == nullptr) {
1292 return nullptr;
1293 }
1294
1295 tsn_update_stack_limit(runtime);
1296
1297 auto* ctx = JS_NewContext(runtime);
1298 if (runtime == nullptr) {
1299 JS_FreeRuntime(runtime);
1300 return nullptr;
1301 }
1302 tsn_add_helpers(ctx);
1303 tsn_load_in_context(ctx);
1304 return ctx;
1305}
1306
1307bool tsn_contains_module(const char* module_name) {
1308 tsn_module_info output;

Callers 2

mainFunction · 0.85
realmMethod · 0.85

Calls 3

tsn_update_stack_limitFunction · 0.85
tsn_add_helpersFunction · 0.85
tsn_load_in_contextFunction · 0.85

Tested by

no test coverage detected