| 345 | } |
| 346 | |
| 347 | int 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. |
nothing calls this directly
no test coverage detected