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

Function isInstanceOf

valdi/src/valdi/hermes/HermesJavaScriptContext.cpp:1015–1026  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1013}
1014
1015static bool isInstanceOf(hermes::vm::Runtime& runtime,
1016 const hermes::vm::Handle<hermes::vm::JSObject>& jsObject,
1017 const hermes::vm::PinnedHermesValue* ctor) {
1018 auto callResult = hermes::vm::instanceOfOperator_RJS(runtime, jsObject, runtime.makeHandle(*ctor));
1019
1020 if (callResult.getStatus() == hermes::vm::ExecutionStatus::EXCEPTION) {
1021 runtime.clearThrownValue();
1022 return false;
1023 }
1024
1025 return callResult.getValue();
1026}
1027
1028ValueType HermesJavaScriptContext::getValueType(const JSValue& value) {
1029 auto* hermesValue = toPinnedHermesValue(value);

Callers 1

getValueTypeMethod · 0.85

Calls 2

getStatusMethod · 0.80
getValueMethod · 0.65

Tested by

no test coverage detected