| 1162 | return nullptr; |
| 1163 | } |
| 1164 | |
| 1165 | auto* nativeState = hermes::vm::vmcast<hermes::vm::NativeState>(result.getValue().get()); |
| 1166 | |
| 1167 | return unwrapNativeClassInstanceData(unsafeBridge<RefCountable>(nativeState->context())); |
| 1168 | } |
| 1169 | |
| 1170 | Ref<JSFunction> HermesJavaScriptContext::valueToFunction(const JSValue& value, JSExceptionTracker& exceptionTracker) { |
| 1171 | hermes::vm::GCScope gcScope(*_runtime); |
| 1172 | auto* hermesValue = toPinnedHermesValue(value); |
| 1173 | if (!hermes::vm::vmisa<hermes::vm::FinalizableNativeFunction>(*hermesValue)) { |
| 1174 | return nullptr; |
| 1175 | } |
| 1176 | |
| 1177 | auto* functionContext = unsafeBridgeUnretained<RefCountable>( |
| 1178 | hermes::vm::vmcast<hermes::vm::FinalizableNativeFunction>(*hermesValue)->getContext()); |
nothing calls this directly
no test coverage detected