Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: call InitializeContextRuntime in InitializeContext #20684

Merged
merged 1 commit into from Oct 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions patches/node/.patches
Expand Up @@ -42,3 +42,4 @@ revert_crypto_add_oaeplabel_option.patch
fix_windows_compilation_on_libuv_setsockopt.patch
fix_don_t_use_node-controlled_preparestacktrace.patch
fix_remove_uses_of_node_use_v8_platform.patch
fix_call_initializecontextruntime_in_initializecontext.patch
@@ -0,0 +1,31 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Tue, 22 Oct 2019 11:00:01 -0700
Subject: fix: call InitializeContextRuntime in InitializeContext


diff --git a/src/api/environment.cc b/src/api/environment.cc
index 50886f4a998f1e7f346a6b7fad91ce49c3a7cdff..6ec07527ad7a806f889d884507e9def1cf68b4c8 100644
--- a/src/api/environment.cc
+++ b/src/api/environment.cc
@@ -371,8 +371,6 @@ Local<Context> NewContext(Isolate* isolate,
return Local<Context>();
}

- InitializeContextRuntime(context);
-
return context;
}

@@ -457,6 +455,11 @@ bool InitializeContext(Local<Context> context) {
}
}

+ // This must be called here because embedders don't necessarily run
+ // NewContext, so when InitializeContext is called this might never
+ // otherwise be called
+ InitializeContextRuntime(context);
+
return true;
}