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

Redo node 7.4 error handling patch #8507

Merged
merged 4 commits into from
Jan 26, 2017
Merged

Conversation

kevinsawicki
Copy link
Contributor

@kevinsawicki kevinsawicki commented Jan 25, 2017

This pull request redoes the patch we apply to node to configure error handling for things like uncaughtException events.

When I upgraded to Node 7.4.0 in #8406 the patch was ported forward but the diff lines were moved to a new function that isn't called by either LoadEnvironment or CreateEnvironment so they weren't getting properly set.

Node 6.5.0 patch: electron/node@f098774

Original Node 7.4.0 patch: electron/node@f1e3c10

New Node 7.4.0 patch: electron/node@8416f53

The diff of the old patch vs the new patch is:

diff --git a/src/node.cc b/src/node.cc
index f80157e..66233d4 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -3415,6 +3415,13 @@ static void RawDebug(const FunctionCallbackInfo<Value>& args) {
 
 
 void LoadEnvironment(Environment* env) {
+  if (g_standalone_mode) {
+    env->isolate()->AddMessageListener(OnMessage);
+  }
+  if (g_upstream_node_mode) {
+    env->isolate()->SetFatalErrorHandler(OnFatalError);
+  }
+
   HandleScope handle_scope(env->isolate());
 
   TryCatch try_catch(env->isolate());
@@ -4500,14 +4507,10 @@ inline int Start(uv_loop_t* event_loop,
   if (isolate == nullptr)
     return 12;  // Signal internal error.
 
-  if (g_standalone_mode) {  // No indent to minimize diff.
   isolate->AddMessageListener(OnMessage);
-  } // g_standalone_mode
   isolate->SetAbortOnUncaughtExceptionCallback(ShouldAbortOnUncaughtException);
   isolate->SetAutorunMicrotasks(false);
-  if (g_upstream_node_mode) {  // No indent to minimize diff.
   isolate->SetFatalErrorHandler(OnFatalError);
-  } // g_upstream_node_mode
 
   if (track_heap_objects) {
     isolate->GetHeapProfiler()->StartTrackingHeapObjects(true);

Closes #8499

@kevinsawicki kevinsawicki changed the title Re-apply node 7.4 error handling patch Redo node 7.4 error handling patch Jan 25, 2017
@kevinsawicki kevinsawicki force-pushed the fix-node-upgrade-patches branch 5 times, most recently from fff9124 to 805b841 Compare January 26, 2017 17:12
@kevinsawicki kevinsawicki merged commit 2ee5f6f into master Jan 26, 2017
@kevinsawicki kevinsawicki deleted the fix-node-upgrade-patches branch January 26, 2017 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant