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

Method isValueFunction

valdi/src/valdi/v8/V8JavaScriptContext.cpp:1017–1027  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1015 v8::Local<v8::Private> privateProp = _functionDataProperty.Get(_isolate);
1016 if (val->HasPrivate(context, privateProp).IsNothing()) {
1017 exceptionTracker.onError("Provided function was not wrapped by the v8 js context");
1018 return nullptr;
1019 }
1020
1021 auto data = v8::Local<v8::External>::Cast(val->GetPrivate(context, privateProp).ToLocalChecked());
1022 if (!data->IsExternal()) {
1023 exceptionTracker.onError("Provided function did not contain data of the expected type");
1024 return nullptr;
1025 }
1026
1027 return unsafeBridge<JSFunction>(data->Value());
1028}
1029
1030ValueType V8JavaScriptContext::getValueType(const JSValue& value) {

Callers 4

getGlobalOnMessageFunction · 0.45
jsValueToFunctionFunction · 0.45
updateErrorHandlerFunction · 0.45

Calls 2

clearErrorMethod · 0.80
fromValdiJSValueFunction · 0.70

Tested by

no test coverage detected