| 360 | auto functionName = newSymbolIDFromString(callable->getReferenceInfo().getName().toStringView()); |
| 361 | |
| 362 | auto functionData = makeShared<JSFunctionData>(*this, callable); |
| 363 | |
| 364 | auto functionResult = hermes::vm::FinalizableNativeFunction::createWithoutPrototype( |
| 365 | *_runtime, unsafeBridgeRetain(functionData.get()), &callTrampoline, &freeContext, functionName.get(), 0); |
| 366 | |
| 367 | if (!checkException(functionResult.getStatus(), exceptionTracker)) { |
| 368 | return newUndefined(); |
| 369 | } |
| 370 | |
| 371 | return toJSValueRefUncached(functionResult.getValue()); |
| 372 | } |
| 373 | |
| 374 | JSValueRef HermesJavaScriptContext::newWeakRef(const JSValue& object, JSExceptionTracker& exceptionTracker) { |
| 375 | hermes::vm::GCScope gcScope(*_runtime); |
| 376 | |
| 377 | auto jsObject = toJSObject(object, exceptionTracker); |
| 378 | if (!exceptionTracker) { |
| 379 | return newUndefined(); |
| 380 | } |
nothing calls this directly
no test coverage detected