diff --git a/index.js b/index.js index f30efa4..c0f6acf 100644 --- a/index.js +++ b/index.js @@ -6,14 +6,11 @@ const natives = [].concat( require('module').builtinModules, 'bootstrap_node', 'node', - 'internal/bootstrap/node' -).map(n => new RegExp(`\\(${n}\\.js:\\d+:\\d+\\)$`)); +).map(n => new RegExp(`(?:\\(${n}\\.js:\\d+:\\d+\\)$|^\\s*at ${n}\\.js:\\d+:\\d+$)`)); natives.push( - // XXX are `bootstrap_node.js` and `node.js` needed in supported versions? - /\s*at (bootstrap_)?node\.js:\d+:\d+?$/, /\(internal\/[^:]+:\d+:\d+\)$/, - /\s*at internal[/]main[/]run_main_module\.js:\d+:\d+$/, + /\s*at internal\/[^:]+:\d+:\d+$/, /\/\.node-spawn-wrap-\w+-\w+\/node:\d+:\d+\)?$/ ); diff --git a/test/test.js b/test/test.js index e0f7956..2ea79ff 100644 --- a/test/test.js +++ b/test/test.js @@ -35,6 +35,7 @@ t.test('clean: truncates cwd', t => { 'Module.load (module.js:344:32)', 'Function.Module._load (module.js:301:12)', 'Function.Module.runMain (module.js:430:10)', + 'module.js:430:10', 'run (bootstrap_node.js:420:7)', 'startup (bootstrap_node.js:139:9)', 'bootstrap_node.js:535:3', @@ -403,6 +404,7 @@ function internalStack() { ' at Module.load (module.js:344:32)', ' at Function.Module._load (module.js:301:12)', ' at Function.Module.runMain (module.js:430:10)', + ' at module.js:430:10', ' at run (bootstrap_node.js:420:7)', ' at startup (bootstrap_node.js:139:9)', ' at bootstrap_node.js:535:3', @@ -412,7 +414,6 @@ function internalStack() { function internals() { return StackUtils.nodeInternals().concat([ - /internal\/main\/run_main_module\.js/, /test\.js:\d+:\d+\)?$/, /\/node_modules\// ]);