Skip to content

Commit 038b636

Browse files
bnoordhuisjasnell
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 83f8d98 commit 038b636

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
@@ -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)