From 8cc8358ef74a2ac0d0a662383977c7c80c75ff94 Mon Sep 17 00:00:00 2001 From: Brian White Date: Fri, 2 Jun 2017 02:07:58 -0400 Subject: [PATCH 1/4] tools: fix node args passing in test runner This fixes a regression from 53c88fa4111 so that special arguments can once again be passed to the node executable when running tests. PR-URL: https://github.com/nodejs/node/pull/13384 Reviewed-By: Luigi Pinca Reviewed-By: Refael Ackermann --- tools/test.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/test.py b/tools/test.py index 8ba5ef6aafa635..d45b4f0de94275 100755 --- a/tools/test.py +++ b/tools/test.py @@ -817,6 +817,10 @@ def GetConfiguration(self, context): (file, pathname, description) = imp.find_module('testcfg', [ self.path ]) module = imp.load_module('testcfg', file, pathname, description) self.config = module.GetConfiguration(context, self.path) + if hasattr(self.config, 'additional_flags'): + self.config.additional_flags += context.node_args + else: + self.config.additional_flags = context.node_args finally: if file: file.close() From e374e44a8a1bed599379fdcf4b5fe142c5e5187d Mon Sep 17 00:00:00 2001 From: Brian White Date: Fri, 2 Jun 2017 02:09:19 -0400 Subject: [PATCH 2/4] events: fix potential permanent deopt PR-URL: https://github.com/nodejs/node/pull/13384 Reviewed-By: Luigi Pinca Reviewed-By: Refael Ackermann --- lib/events.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/events.js b/lib/events.js index 1609d66192e333..c49df9fab84f46 100644 --- a/lib/events.js +++ b/lib/events.js @@ -306,10 +306,25 @@ EventEmitter.prototype.prependListener = }; function onceWrapper() { - this.target.removeListener(this.type, this.wrapFn); if (!this.fired) { + this.target.removeListener(this.type, this.wrapFn); this.fired = true; - this.listener.apply(this.target, arguments); + switch (arguments.length) { + case 0: + return this.listener.call(this.target); + case 1: + return this.listener.call(this.target, arguments[0]); + case 2: + return this.listener.call(this.target, arguments[0], arguments[1]); + case 3: + return this.listener.call(this.target, arguments[0], arguments[1], + arguments[2]); + default: + const args = new Array(arguments.length); + for (var i = 0; i < args.length; ++i) + args[i] = arguments[i]; + this.listener.apply(this.target, args); + } } } From fc6f487f2e2eaa54e2de38b1cf9529dec5f8fcd5 Mon Sep 17 00:00:00 2001 From: Brian White Date: Fri, 2 Jun 2017 02:09:58 -0400 Subject: [PATCH 3/4] process: fix permanent deopt PR-URL: https://github.com/nodejs/node/pull/13384 Reviewed-By: Luigi Pinca Reviewed-By: Refael Ackermann --- lib/internal/process/warning.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/process/warning.js b/lib/internal/process/warning.js index 033005e6ed6c89..3208fb098d0a97 100644 --- a/lib/internal/process/warning.js +++ b/lib/internal/process/warning.js @@ -90,7 +90,7 @@ function setupProcessWarnings() { if (isDeprecation && process.noDeprecation) return; const trace = process.traceProcessWarnings || (isDeprecation && process.traceDeprecation); - let msg = `${prefix}`; + var msg = `${prefix}`; if (warning.code) msg += `[${warning.code}] `; if (trace && warning.stack) { From d081548858ae2c89e22c6e9a231644fba08e008e Mon Sep 17 00:00:00 2001 From: Brian White Date: Fri, 2 Jun 2017 02:10:11 -0400 Subject: [PATCH 4/4] net: fix permanent deopt PR-URL: https://github.com/nodejs/node/pull/13384 Reviewed-By: Luigi Pinca Reviewed-By: Refael Ackermann --- lib/net.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/net.js b/lib/net.js index 07344ea7c7794c..3bd3de9ed3079e 100644 --- a/lib/net.js +++ b/lib/net.js @@ -949,8 +949,8 @@ Socket.prototype.connect = function() { // TODO(joyeecheung): use destructuring when V8 is fast enough normalized = normalizeArgs(args); } - const options = normalized[0]; - const cb = normalized[1]; + var options = normalized[0]; + var cb = normalized[1]; if (this.write !== Socket.prototype.write) this.write = Socket.prototype.write;