| 302 | } |
| 303 | |
| 304 | Valdi::JSValueRef QuickJSJavaScriptContext::evaluatePreCompiled(const Valdi::BytesView& script, |
| 305 | const std::string_view& /*sourceFilename*/, |
| 306 | Valdi::JSExceptionTracker& exceptionTracker) { |
| 307 | auto guard = _threadAccessChecker.guard(); |
| 308 | auto result = checkCallAndGetValue( |
| 309 | exceptionTracker, |
| 310 | JS_ReadObject(_context, reinterpret_cast<const uint8_t*>(script.data()), script.size(), JS_READ_OBJ_BYTECODE)); |
| 311 | |
| 312 | if (!exceptionTracker) { |
| 313 | return Valdi::JSValueRef(); |
| 314 | } |
| 315 | |
| 316 | auto retainedResult = JS_DupValue(_context, fromValdiJSValue(result.get())); |
| 317 | |
| 318 | return checkCallAndGetValue(exceptionTracker, JS_EvalFunction(_context, retainedResult)); |
| 319 | } |
| 320 | |
| 321 | Valdi::JSValueRef QuickJSJavaScriptContext::evaluate(const std::string& script, |
| 322 | const std::string_view& sourceFilename, |
nothing calls this directly
no test coverage detected