| 133 | } |
| 134 | |
| 135 | bool tns::V8SetPrivateValue(Isolate* isolate, const Local<Object>& obj, const Local<String>& propName, const Local<Value>& value) { |
| 136 | auto privateKey = Private::ForApi(isolate, propName); |
| 137 | auto context = obj->CreationContext(); |
| 138 | auto res = obj->SetPrivate(context, privateKey, value); |
| 139 | |
| 140 | if (res.IsNothing()) { |
| 141 | stringstream ss; |
| 142 | ss << "Failed to Set Private Value for prop: " << ArgConverter::ConvertToString(propName).c_str() << endl; |
| 143 | throw tns::NativeScriptException(ss.str()); |
| 144 | } |
| 145 | |
| 146 | return res.FromMaybe(false); |
| 147 | } |
| 148 | |
| 149 | void tns::V8GlobalHelpers::onDisposeIsolate(Isolate* isolate) { |
| 150 | isolateToPersistentSmartJSONStringify.erase(isolate); |
nothing calls this directly
no test coverage detected