| 1015 | v8::Local<v8::Private> privateProp = _functionDataProperty.Get(_isolate); |
| 1016 | if (val->HasPrivate(context, privateProp).IsNothing()) { |
| 1017 | exceptionTracker.onError("Provided function was not wrapped by the v8 js context"); |
| 1018 | return nullptr; |
| 1019 | } |
| 1020 | |
| 1021 | auto data = v8::Local<v8::External>::Cast(val->GetPrivate(context, privateProp).ToLocalChecked()); |
| 1022 | if (!data->IsExternal()) { |
| 1023 | exceptionTracker.onError("Provided function did not contain data of the expected type"); |
| 1024 | return nullptr; |
| 1025 | } |
| 1026 | |
| 1027 | return unsafeBridge<JSFunction>(data->Value()); |
| 1028 | } |
| 1029 | |
| 1030 | ValueType V8JavaScriptContext::getValueType(const JSValue& value) { |
no test coverage detected