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

Method newPromise

valdi/src/valdi/runtime/Interfaces/IJavaScriptContext.cpp:308–324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

306 return JavaScriptLong();
307 }
308
309 return JavaScriptLong(static_cast<int32_t>(lowValue), static_cast<int32_t>(highValue), isUnsignedValue);
310}
311
312JSValueRef IJavaScriptContext::evaluateNative(const std::string_view& /*sourceFilename*/,
313 JSExceptionTracker& exceptionTracker) {
314 exceptionTracker.onError("Native module evaluation is not supported in this JS context");
315 return JSValueRef();
316}
317
318std::optional<IJavaScriptNativeModuleInfo> IJavaScriptContext::getNativeModuleInfo(
319 const std::string_view& /*sourceFilename*/) {
320 return std::nullopt;
321}
322
323JSValueRef IJavaScriptContext::newPromise(const JSValueRef& executor, JSExceptionTracker& exceptionTracker) {
324 if (_promiseConstructor.empty()) {
325 auto globalObject = getGlobalObject(exceptionTracker);
326 if (!exceptionTracker) {
327 return globalObject;

Callers 1

newBridgedPromiseMethod · 0.80

Calls 2

getMethod · 0.65
emptyMethod · 0.45

Tested by

no test coverage detected