Skip to content

Commit 608c626

Browse files
bnoordhuisMichael Scovetta
authored andcommitted
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: nodejs#4575 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 7202c03 commit 608c626

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/module.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ Module.prototype.load = function(filename) {
374374
Module.prototype.require = function(path) {
375375
assert(path, 'missing path');
376376
assert(typeof path === 'string', 'path must be a string');
377-
return Module._load(path, this);
377+
return Module._load(path, this, /* isMain */ false);
378378
};
379379

380380

0 commit comments

Comments
 (0)