MCPcopy Create free account
hub / github.com/Kudo/react-native-v8 / createWeakObject

Method createWeakObject

src/v8runtime/V8Runtime.cpp:1261–1276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1259}
1260
1261jsi::WeakObject V8Runtime::createWeakObject(const jsi::Object &weakObject) {
1262 v8::Locker locker(isolate_);
1263 v8::Isolate::Scope scopedIsolate(isolate_);
1264 v8::HandleScope scopedHandle(isolate_);
1265 v8::Context::Scope scopedContext(context_.Get(isolate_));
1266
1267 const V8PointerValue *v8PointerValue =
1268 static_cast<const V8PointerValue *>(getPointerValue(weakObject));
1269 assert(v8PointerValue->Get(isolate_)->IsObject());
1270
1271 v8::Global<v8::Value> weakRef =
1272 v8::Global<v8::Value>(isolate_, v8PointerValue->Get(isolate_));
1273 weakRef.SetWeak();
1274 return make<jsi::WeakObject>(
1275 new V8PointerValue(isolate_, std::move(weakRef)));
1276}
1277
1278#if REACT_NATIVE_MINOR_VERSION >= 72
1279jsi::Value V8Runtime::lockWeakObject(const jsi::WeakObject &weakObject) {

Callers

nothing calls this directly

Calls 1

GetMethod · 0.80

Tested by

no test coverage detected