| 6 | static Reference<Buffer<uint8_t>> weak; |
| 7 | |
| 8 | static void RefMoveAssignTests(const Napi::CallbackInfo& info) { |
| 9 | Napi::Object obj = Napi::Object::New(info.Env()); |
| 10 | obj.Set("tPro", "tTEST"); |
| 11 | Napi::Reference<Napi::Object> ref = Napi::Reference<Napi::Object>::New(obj); |
| 12 | ref.SuppressDestruct(); |
| 13 | |
| 14 | napi_ref obj_ref = static_cast<napi_ref>(ref); |
| 15 | Napi::Reference<Napi::Object> existingRef = |
| 16 | Napi::Reference<Napi::Object>(info.Env(), obj_ref); |
| 17 | assert(ref == existingRef); |
| 18 | assert(!(ref != existingRef)); |
| 19 | |
| 20 | std::string val = |
| 21 | MaybeUnwrap(existingRef.Value().Get("tPro")).As<Napi::String>(); |
| 22 | assert(val == "tTEST"); |
| 23 | // ------------------------------------------------------------ // |
| 24 | Napi::Reference<Napi::Object> copyMoveRef = std::move(existingRef); |
| 25 | assert(copyMoveRef == ref); |
| 26 | |
| 27 | Napi::Reference<Napi::Object> copyAssignRef; |
| 28 | copyAssignRef = std::move(copyMoveRef); |
| 29 | assert(copyAssignRef == ref); |
| 30 | } |
| 31 | |
| 32 | static void ReferenceRefTests(const Napi::CallbackInfo& info) { |
| 33 | Napi::Object obj = Napi::Object::New(info.Env()); |
nothing calls this directly
no test coverage detected