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

Update require wrapper to allow redefinition of process and global #8539

Merged
merged 4 commits into from
Jan 30, 2017

Conversation

kevinsawicki
Copy link
Contributor

@kevinsawicki kevinsawicki commented Jan 30, 2017

This pull request is an update of #8382

It rebases the node patch on top of the Node 7.4.0 upgrade in #8406

The vendor/node diff is a redo of the NativeModule patch with the following diff:

diff --git a/lib/internal/bootstrap_node.js b/lib/internal/bootstrap_node.js
index e3d9613..1c15912 100644
--- a/lib/internal/bootstrap_node.js
+++ b/lib/internal/bootstrap_node.js
@@ -512,9 +512,8 @@
   };
 
   NativeModule.wrapper = [
-    '(function (exports, require, module, __filename, __dirname, process, global) { ' +
-    'return function (exports, require, module, __filename, __dirname) { ',
-    '\n}(exports, require, module, __filename, __dirname); });'
+    '(function (exports, require, module, __filename, __dirname, process, global) { ',
+    '\n});'
   ];
 
   NativeModule.prototype.compile = function() {

Fixes #8358

/cc @ide

ide and others added 2 commits January 30, 2017 09:37
See the fixed issue for the context. This pulls in a vendored copy of Node that includes the described patch.

Fixes #8358

Test Plan: Built Electron and verified it loaded the sample app correctly and that the module wrapper is the new one by viewing Node's source code in the Blink Inspector.

Added specs and tested with `npm test -- --grep "global variables"`
@ide
Copy link
Contributor

ide commented Jan 30, 2017

Thanks for taking care of the rebase and updating the tests!

@kevinsawicki kevinsawicki merged commit 37eebb1 into master Jan 30, 2017
@kevinsawicki kevinsawicki deleted the require-wrapper branch January 30, 2017 18:36
@kevinsawicki
Copy link
Contributor Author

Thanks for this @ide 👍

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.

None yet

2 participants