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

Function DetectModuleSourceWithProbe

bridge.c:347–363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

345}
346
347int DetectModuleSourceWithProbe(JSContext *ctx, const char *code, size_t code_len) {
348 if (!JS_DetectModule(code, code_len)) {
349 return 0;
350 }
351
352 static const char *probe_filename = "<module-detect>";
353 int probe_flags = JS_EVAL_TYPE_GLOBAL | JS_EVAL_FLAG_COMPILE_ONLY;
354 JSValue probe = JS_Eval(ctx, code, code_len, probe_filename, probe_flags);
355 if (JS_IsException(probe)) {
356 JSValue exception = JS_GetException(ctx);
357 JS_FreeValue(ctx, exception);
358 return 1;
359 }
360
361 JS_FreeValue(ctx, probe);
362 return 0;
363}
364
365/*
366 * quickjs-go local await helper.

Callers

nothing calls this directly

Calls 1

JS_IsExceptionFunction · 0.85

Tested by

no test coverage detected