Skip to content

Commit

Permalink
module: avoid ArgumentsAdaptorTrampoline frame
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
bnoordhuis authored and rvagg committed Jan 14, 2016
1 parent 8f0cf38 commit d8f5bd4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,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);
};


Expand Down

0 comments on commit d8f5bd4

Please sign in to comment.