Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Ijaz Sheikh <ofrobots@google.com>2016-02-29 23:29:18 +0300
committerAli Sheikh <ofrobots@lemonhope.roam.corp.google.com>2016-03-04 07:35:20 +0300
commit536cfecd711390654e1a11ec159f3f44f51756e8 (patch)
treedc351d85455059b3f80ce5e554d7ca114c88292c /src/node_object_wrap.h
parent492fbfbff8de01d7de6f5ad20a5756dc6c109520 (diff)
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.h9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/node_object_wrap.h b/src/node_object_wrap.h
index 2d67bc1db67..8f695fd9dd0 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;
}