| 827 | Valdi::JSExceptionTracker& exceptionTracker) { |
| 828 | if (_weakRefConstructor == nullptr) { |
| 829 | // No support for weak refs |
| 830 | auto jsValue = fromValdiJSValue(weakRef); |
| 831 | return returnJSValueRef(jsValue.valueRef, jsValue.type); |
| 832 | } else { |
| 833 | auto derefFn = toUnretainedJSValueRef(_weakRefDerefFunction, kJSTypeObject); |
| 834 | |
| 835 | Valdi::JSFunctionCallContext callContext(*this, nullptr, 0, exceptionTracker); |
| 836 | callContext.setThisValue(weakRef); |
| 837 | |
| 838 | auto target = callObjectAsFunction(derefFn.get(), callContext); |
| 839 | // iOS links the system JavaScriptCore, and the one shipped with iOS 15 returns null from |
| 840 | // WeakRef.prototype.deref() for a collected target. iOS 16+, the spec, and the other |
| 841 | // engines return undefined. |
| 842 | if (isValueNull(target.get())) { |
| 843 | return newUndefined(); |
| 844 | } |
nothing calls this directly
no test coverage detected