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

Method runtimeOutputLog

valdi/src/valdi/runtime/JavaScript/JavaScriptRuntime.cpp:533–565  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

531
532 std::unique_ptr<JavaScriptRuntimeDeserializers> runtimeDeserializers;
533
534 IJavaScriptContextConfig config;
535
536 JSExceptionTracker exceptionTracker(*jsContext);
537 jsContext->initialize(config, exceptionTracker);
538
539 if (exceptionTracker) {
540 jsContext->startDebugger(_isWorker);
541
542 runtimeDeserializers =
543 std::make_unique<JavaScriptRuntimeDeserializers>(*jsContext, _stringCache, getStyleAttributesCache());
544 buildContext(*jsContext, runtimeTweaks, exceptionTracker);
545 }
546
547 if (exceptionTracker) {
548 _javaScriptContext = std::move(jsContext);
549 _runtimeDeserializers = std::move(runtimeDeserializers);
550 _propertyNameIndex.setContext(_javaScriptContext.get());
551 return Void();
552 } else {
553 return exceptionTracker.extractError();
554 }
555}
556
557const Ref<DispatchQueue>& JavaScriptRuntime::getJsDispatchQueue() const {
558 return _dispatchQueue;
559}
560
561void JavaScriptRuntime::setValueToGlobalObject(const StringBox& name, const Value& value) {
562 dispatchOnJsThreadUnattributed([=](JavaScriptEntryParameters& entry) {
563 auto globalKey = STRING_LITERAL("global");
564 auto jsValueResult = valueToJSValue(entry.jsContext,
565 value,
566 ReferenceInfoBuilder().withObject(globalKey).withProperty(name),
567 entry.exceptionTracker);
568 if (!entry.exceptionTracker) {

Callers

nothing calls this directly

Calls 10

getParameterMethod · 0.80
newUndefinedMethod · 0.80
throwErrorMethod · 0.65
logMethod · 0.65
ErrorInterface · 0.50
valueToIntMethod · 0.45
getContextMethod · 0.45
isEnabledForTypeMethod · 0.45
valueToStaticStringMethod · 0.45
toStdStringMethod · 0.45

Tested by

no test coverage detected