From 038b636562444574d5256bf4ac198ed808e65537 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Thu, 7 Jan 2016 22:50:09 +0100 Subject: [PATCH] module: avoid ArgumentsAdaptorTrampoline frame Avoid an unneeded ArgumentsAdaptorTrampoline stack frame by passing the the right number of arguments to Module._load() in Module.require(). Shortens the following stack trace with one frame: LazyCompile:~Module.load module.js:345 LazyCompile:Module._load module.js:282 Builtin:ArgumentsAdaptorTrampoline LazyCompile:*Module.require module.js:361 LazyCompile:*require internal/module.js:11 PR-URL: https://github.com/nodejs/node/pull/4575 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- lib/module.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/module.js b/lib/module.js index b51772ad59dbee..a068bffa7d9056 100644 --- a/lib/module.js +++ b/lib/module.js @@ -374,7 +374,7 @@ Module.prototype.load = function(filename) { Module.prototype.require = function(path) { assert(path, 'missing path'); assert(typeof path === 'string', 'path must be a string'); - return Module._load(path, this); + return Module._load(path, this, /* isMain */ false); };