Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4f2c839

Browse filesBrowse files
ofrobotsrvagg
authored andcommitted
contextify: replace deprecated SetWeak usage
PR-URL: #5392 Reviewed-By: Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
1 parent bfff07b commit 4f2c839
Copy full SHA for 4f2c839

File tree

Expand file treeCollapse file tree

1 file changed

+3
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-5
lines changed
Open diff view settings
Collapse file

‎src/node_contextify.cc‎

Copy file name to clipboardExpand all lines: src/node_contextify.cc
+3-5Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ using v8::Uint8Array;
4545
using v8::UnboundScript;
4646
using v8::V8;
4747
using v8::Value;
48-
using v8::WeakCallbackData;
48+
using v8::WeakCallbackInfo;
4949

5050

5151
class ContextifyContext {
@@ -66,7 +66,7 @@ class ContextifyContext {
6666
// Allocation failure or maximum call stack size reached
6767
if (context_.IsEmpty())
6868
return;
69-
context_.SetWeak(this, WeakCallback<Context>);
69+
context_.SetWeak(this, WeakCallback, v8::WeakCallbackType::kParameter);
7070
context_.MarkIndependent();
7171
}
7272

@@ -304,10 +304,8 @@ class ContextifyContext {
304304
}
305305

306306

307-
template <class T>
308-
static void WeakCallback(const WeakCallbackData<T, ContextifyContext>& data) {
307+
static void WeakCallback(const WeakCallbackInfo<ContextifyContext>& data) {
309308
ContextifyContext* context = data.GetParameter();
310-
context->context_.ClearWeak();
311309
delete context;
312310
}
313311

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.