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

Method symbolicateError

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

Source from the content-addressed store, hash-verified

3032 if (!jsEntry.exceptionTracker) {
3033 return;
3034 }
3035
3036 jsParameters.emplace_back(jsEntry.jsContext.ensureRetainedValue(std::move(jsParameter)));
3037 }
3038
3039 JSFunctionCallContext callContext(
3040 jsEntry.jsContext, jsParameters.data(), jsParameters.size(), jsEntry.exceptionTracker);
3041 jsEntry.jsContext.callObjectProperty(moduleJsValue, functionName.toStringView(), callContext);
3042 } else {
3043 JSFunctionCallContext callContext(jsEntry.jsContext, nullptr, 0, jsEntry.exceptionTracker);
3044 jsEntry.jsContext.callObjectProperty(moduleJsValue, functionName.toStringView(), callContext);
3045 }
3046 });
3047}
3048
3049Error JavaScriptRuntime::onModuleLoadFailed(const Error& error, const ResourceId& resourceId) {
3050 return error.rethrow(STRING_FORMAT("Failed to load JS module '{}'", resourceId));
3051}
3052
3053void JavaScriptRuntime::initializeModuleLoader(JavaScriptEntryParameters& jsEntry) {
3054 loadJsModule(jsEntry.jsContext, STRING_LITERAL("valdi_core/src/Init"), true, nullptr, 0, jsEntry.exceptionTracker);
3055 if (!jsEntry.exceptionTracker) {
3056 return;
3057 }
3058 auto globalObjectResult = jsEntry.jsContext.getGlobalObject(jsEntry.exceptionTracker);
3059 if (!jsEntry.exceptionTracker) {
3060 return;
3061 }
3062
3063 _moduleLoader =
3064 jsEntry.jsContext.getObjectProperty(globalObjectResult.get(), "moduleLoader", jsEntry.exceptionTracker);
3065 if (!jsEntry.exceptionTracker) {
3066 return;
3067 }
3068 _moduleLoader = jsEntry.jsContext.ensureRetainedValue(std::move(_moduleLoader));
3069
3070 auto longObject = jsEntry.jsContext.getObjectProperty(globalObjectResult.get(), "Long", jsEntry.exceptionTracker);
3071 if (!jsEntry.exceptionTracker) {
3072 return;
3073 }
3074
3075 if (!jsEntry.jsContext.isValueFunction(longObject.get())) {
3076 jsEntry.exceptionTracker.onError(Error("Failed to resolve Long constructor"));
3077 return;
3078 }
3079
3080 jsEntry.jsContext.setLongConstructor(longObject);
3081}

Callers 2

getStackTraceMethod · 0.45

Calls 11

toResultMethod · 0.80
getJsValueMethod · 0.80
toRetainedResultMethod · 0.80
clearErrorMethod · 0.80
valueMethod · 0.65
errorMethod · 0.65
getMethod · 0.65
emptyMethod · 0.45
getObjectPropertyMethod · 0.45
successMethod · 0.45
callObjectAsFunctionMethod · 0.45

Tested by

no test coverage detected