Skip to content

Commit d8f5bd4

Browse files
bnoordhuisrvagg
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: #4575 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 8f0cf38 commit d8f5bd4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/module.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ Module.prototype.load = function(filename) {
350350
Module.prototype.require = function(path) {
351351
assert(path, 'missing path');
352352
assert(typeof path === 'string', 'path must be a string');
353-
return Module._load(path, this);
353+
return Module._load(path, this, /* isMain */ false);
354354
};
355355

356356

0 commit comments

Comments
 (0)