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); + } } } 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) { 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; 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()