diff options
author | Ali Ijaz Sheikh <ofrobots@google.com> | 2016-02-29 12:29:18 -0800 |
---|---|---|
committer | Ali Sheikh <ofrobots@lemonhope.roam.corp.google.com> | 2016-03-03 20:35:20 -0800 |
commit | 536cfecd711390654e1a11ec159f3f44f51756e8 (patch) | |
tree | dc351d85455059b3f80ce5e554d7ca114c88292c /src/node_object_wrap.h | |
parent | 492fbfbff8de01d7de6f5ad20a5756dc6c109520 (diff) | |
download | node-new-536cfecd711390654e1a11ec159f3f44f51756e8.tar.gz |
src: replace deprecated SetWeak in object_wrap
Migrate node_object_wrap.h to the new SetWeak API.
PR-URL: https://github.com/nodejs/node/pull/5494
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: targos - Michaƫl Zasso <mic.besace@gmail.com>
Diffstat (limited to 'src/node_object_wrap.h')
-rw-r--r-- | src/node_object_wrap.h | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/node_object_wrap.h b/src/node_object_wrap.h index 2d67bc1db6..8f695fd9dd 100644 --- a/src/node_object_wrap.h +++ b/src/node_object_wrap.h @@ -61,7 +61,7 @@ class ObjectWrap { inline void MakeWeak(void) { - persistent().SetWeak(this, WeakCallback); + persistent().SetWeak(this, WeakCallback, v8::WeakCallbackType::kParameter); persistent().MarkIndependent(); } @@ -96,14 +96,9 @@ class ObjectWrap { private: static void WeakCallback( - const v8::WeakCallbackData<v8::Object, ObjectWrap>& data) { - v8::Isolate* isolate = data.GetIsolate(); - v8::HandleScope scope(isolate); + const v8::WeakCallbackInfo<ObjectWrap>& data) { ObjectWrap* wrap = data.GetParameter(); assert(wrap->refs_ == 0); - assert(wrap->handle_.IsNearDeath()); - assert( - data.GetValue() == v8::Local<v8::Object>::New(isolate, wrap->handle_)); wrap->handle_.Reset(); delete wrap; } |