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

Method evaluate

valdi/src/valdi/quickjs/QuickJSJavaScriptContext.cpp:321–328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

319Valdi::JSValueRef QuickJSJavaScriptContext::evaluatePreCompiled(const Valdi::BytesView& script,
320 const std::string_view& /*sourceFilename*/,
321 Valdi::JSExceptionTracker& exceptionTracker) {
322 auto guard = _threadAccessChecker.guard();
323 auto result = checkCallAndGetValue(
324 exceptionTracker,
325 JS_ReadObject(_context, reinterpret_cast<const uint8_t*>(script.data()), script.size(), JS_READ_OBJ_BYTECODE));
326
327 if (!exceptionTracker) {
328 return Valdi::JSValueRef();
329 }
330
331 auto retainedResult = JS_DupValue(_context, fromValdiJSValue(result.get()));

Callers

nothing calls this directly

Calls 3

guardMethod · 0.80
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected