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

Method hasObjectProperty

valdi/src/valdi/v8/V8JavaScriptContext.cpp:587–609  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

585JSValueRef V8JavaScriptContext::newNativeClass(const Ref<RefCountable>& /*classOpaque*/,
586 const JSClassDefinition& /*classDefinition*/,
587 JSExceptionTracker& exceptionTracker) {
588 // TODO: Implement native-class support or Base64/Unicode module fallbacks before enabling V8.
589 exceptionTracker.onError("Native classes are not supported by V8");
590 return JSValueRef();
591}
592
593JSValueRef V8JavaScriptContext::newObjectFromNativeClass(const Ref<RefCountable>& /*opaque*/,
594 const JSValue& /*cls*/,
595 JSExceptionTracker& exceptionTracker) {
596 exceptionTracker.onError("Native classes are not supported by V8");
597 return JSValueRef();
598}
599
600JSValueRef V8JavaScriptContext::newWeakRef(const JSValue& object, JSExceptionTracker& exceptionTracker) {
601 v8::HandleScope handleScope(_isolate);
602 auto indirect = fromValdiJSValueToIndirect(object);
603 return toUnretainedJSValueRef(indirect);
604}
605
606JSValueRef V8JavaScriptContext::derefWeakRef(const JSValue& weakRef, JSExceptionTracker& exceptionTracker) {
607 v8::HandleScope handleScope(_isolate);
608 auto indirect = fromValdiJSValueToIndirect(weakRef);
609 if (indirect.isEmpty()) {
610 exceptionTracker.onError("Object cannot be dereferenced");
611 return JSValueRef();
612 }

Callers 2

isJSPromiseCancelableMethod · 0.45
hasValueForObjectKeyMethod · 0.45

Calls 6

clearErrorMethod · 0.80
fromValdiJSValueFunction · 0.70
fromValdiJSPropertyNameFunction · 0.70
CastFunction · 0.50
NewFunction · 0.50
FromMaybeMethod · 0.45

Tested by

no test coverage detected