GeezerVison is showing github.com — contextify: replace deprecated SetWeak usage · nodejs/node@8ebdcd6
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: src/node_contextify.cc +3-5Lines changed: 3 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -43,7 +43,7 @@ using v8::TryCatch; |
43 | 43 | using v8::UnboundScript; |
44 | 44 | using v8::V8; |
45 | 45 | using v8::Value; |
46 | | -using v8::WeakCallbackData; |
| 46 | +using v8::WeakCallbackInfo; |
47 | 47 |
|
48 | 48 |
|
49 | 49 | class ContextifyContext { |
@@ -64,7 +64,7 @@ class ContextifyContext { |
64 | 64 | // Allocation failure or maximum call stack size reached |
65 | 65 | if (context_.IsEmpty()) |
66 | 66 | return; |
67 | | - context_.SetWeak(this, WeakCallback<Context>); |
| 67 | + context_.SetWeak(this, WeakCallback, v8::WeakCallbackType::kParameter); |
68 | 68 | context_.MarkIndependent(); |
69 | 69 | } |
70 | 70 |
|
@@ -302,10 +302,8 @@ class ContextifyContext { |
302 | 302 | } |
303 | 303 |
|
304 | 304 |
|
305 | | - template <class T> |
306 | | - static void WeakCallback(const WeakCallbackData<T, ContextifyContext>& data) { |
| 305 | + static void WeakCallback(const WeakCallbackInfo<ContextifyContext>& data) { |
307 | 306 | ContextifyContext* context = data.GetParameter(); |
308 | | - context->context_.ClearWeak(); |
309 | 307 | delete context; |
310 | 308 | } |
311 | 309 |
|
|