GeezerVison is showing github.com — contextify: replace deprecated SetWeak usage · outsideris/node@95ebc74
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 |
|---|
@@ -45,7 +45,7 @@ using v8::Uint8Array; |
45 | 45 | using v8::UnboundScript; |
46 | 46 | using v8::V8; |
47 | 47 | using v8::Value; |
48 | | -using v8::WeakCallbackData; |
| 48 | +using v8::WeakCallbackInfo; |
49 | 49 |
|
50 | 50 |
|
51 | 51 | class ContextifyContext { |
@@ -66,7 +66,7 @@ class ContextifyContext { |
66 | 66 | // Allocation failure or maximum call stack size reached |
67 | 67 | if (context_.IsEmpty()) |
68 | 68 | return; |
69 | | - context_.SetWeak(this, WeakCallback<Context>); |
| 69 | + context_.SetWeak(this, WeakCallback, v8::WeakCallbackType::kParameter); |
70 | 70 | context_.MarkIndependent(); |
71 | 71 | } |
72 | 72 |
|
@@ -304,10 +304,8 @@ class ContextifyContext { |
304 | 304 | } |
305 | 305 |
|
306 | 306 |
|
307 | | - template <class T> |
308 | | - static void WeakCallback(const WeakCallbackData<T, ContextifyContext>& data) { |
| 307 | + static void WeakCallback(const WeakCallbackInfo<ContextifyContext>& data) { |
309 | 308 | ContextifyContext* context = data.GetParameter(); |
310 | | - context->context_.ClearWeak(); |
311 | 309 | delete context; |
312 | 310 | } |
313 | 311 |
|
|