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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forward `this` in require wrapper #8618

Merged
merged 4 commits into from Feb 8, 2017

Conversation

Projects
None yet
1 participant
@kevinsawicki
Contributor

kevinsawicki commented Feb 7, 2017

Updates the node require function wrapper patch to pass through the this value of the outer function.

This fixes a regression introduced in #8539

diff --git a/lib/internal/bootstrap_node.js b/lib/internal/bootstrap_node.js
index e3d9613..65567de 100644
--- a/lib/internal/bootstrap_node.js
+++ b/lib/internal/bootstrap_node.js
@@ -514,7 +514,7 @@
   NativeModule.wrapper = [
     '(function (exports, require, module, __filename, __dirname, process, global) { ' +
     'return function (exports, require, module, __filename, __dirname) { ',
-    '\n}(exports, require, module, __filename, __dirname); });'
+    '\n}.call(this, exports, require, module, __filename, __dirname); });'
   ];
 
   NativeModule.prototype.compile = function() {

Hat tip to @MarshallOfSound for investigating and putting forth this fix 馃憤 馃帺

Closes #8611

@kevinsawicki kevinsawicki merged commit d00a96c into master Feb 8, 2017

8 of 9 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
electron-linux-arm Build #5440979 succeeded in 66s
Details
electron-linux-ia32 Build #5440980 succeeded in 60s
Details
electron-linux-x64 Build #5440981 succeeded in 131s
Details
electron-mas-x64 Build #3365 succeeded in 7 min 33 sec
Details
electron-osx-x64 Build #3374 succeeded in 8 min 4 sec
Details
electron-win-ia32 Build #2377 succeeded in 7 min 59 sec
Details
electron-win-x64 Build #2363 succeeded in 8 min 7 sec
Details

@kevinsawicki kevinsawicki deleted the forward-this-in-require-wrapper branch Feb 8, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment