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

Function tsn_require_absolute

tsn/src/tsn/tsn.cpp:247–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

245}
246
247static tsn_value tsn_require_absolute(tsn_vm* ctx, tsn_value_const /*this_val*/, int argc, tsn_value_const* argv) {
248 if (argc < 1) {
249 return JS_ThrowReferenceError(ctx, "Missing module name argument");
250 }
251
252 auto moduleName = JS_ValueToAtom(ctx, argv[0]);
253
254 auto loadedModule = tsn_require(ctx, moduleName);
255
256 tsn_free_atom(ctx, moduleName);
257
258 return loadedModule;
259}
260
261static tsn_value tsn_require_relative(
262 tsn_vm* ctx, tsn_value_const /*this_val*/, int argc, tsn_value_const* argv, int /*magic*/, tsn_value* func_data) {

Callers

nothing calls this directly

Calls 2

tsn_requireFunction · 0.85
tsn_free_atomFunction · 0.85

Tested by

no test coverage detected