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

Method isValueNull

valdi/src/valdi/v8/V8JavaScriptContext.cpp:1006–1016  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1004
1005Ref<JSFunction> V8JavaScriptContext::valueToFunction(const JSValue& value, JSExceptionTracker& exceptionTracker) {
1006 v8::HandleScope handleScope(_isolate);
1007
1008 auto val = v8::Local<v8::Function>::Cast(fromValdiJSValue(_isolate, value, exceptionTracker));
1009 if (!val->IsFunction()) {
1010 exceptionTracker.onError("Was not provided with a function value");
1011 return nullptr;
1012 }
1013
1014 v8::Local<v8::Context> context = v8::Local<v8::Context>::New(_isolate, _context);
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 }

Callers 1

valueIsNullMethod · 0.45

Calls 3

clearErrorMethod · 0.80
IsNullMethod · 0.80
fromValdiJSValueFunction · 0.70

Tested by

no test coverage detected