| 302 | JS_Eval(_context, |
| 303 | reinterpret_cast<const char*>(formattedScript.data()), |
| 304 | formattedScript.length(), |
| 305 | sourceFilename.data(), |
| 306 | JS_EVAL_FLAG_COMPILE_ONLY)); |
| 307 | if (!exceptionTracker) { |
| 308 | return Valdi::BytesView(); |
| 309 | } |
| 310 | |
| 311 | size_t objectSize = 0; |
| 312 | |
| 313 | auto* buffer = JS_WriteObject(_context, &objectSize, fromValdiJSValue(evalResult.get()), JS_WRITE_OBJ_BYTECODE); |
| 314 | if (buffer == nullptr) { |
| 315 | checkCallAndGetValue(exceptionTracker, JS_ThrowInternalError(_context, "Could not write object")); |
| 316 | return Valdi::BytesView(); |
| 317 | } |
| 318 | |
| 319 | auto jsModule = Valdi::makePreCompiledJsModule(reinterpret_cast<const Valdi::Byte*>(buffer), objectSize); |
| 320 | |
| 321 | js_free(_context, buffer); |
| 322 |
nothing calls this directly
no test coverage detected