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

Function tsn_require_from_string

tsn/src/tsn/tsn.cpp:372–381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

370}
371
372tsn_value tsn_require_from_string(tsn_vm* ctx, const char* module_name) {
373 auto moduleNameAtom = JS_NewAtom(ctx, module_name);
374 if (moduleNameAtom == 0) {
375 return tsn_exception(ctx);
376 }
377
378 auto output = tsn_require(ctx, moduleNameAtom);
379 JS_FreeAtom(ctx, moduleNameAtom);
380 return output;
381}
382
383void tsn_debug(tsn_vm* ctx, tsn_value_const value, const char* expression) {
384 std::string script = "(($input) => ";

Callers 3

mainFunction · 0.85
tsn_require_relativeFunction · 0.85
tsn_load_in_contextFunction · 0.85

Calls 2

tsn_exceptionFunction · 0.85
tsn_requireFunction · 0.85

Tested by

no test coverage detected