esm: avoid throw when module specifier is not url · nodejs/node@f12eb28 · GitHub
Skip to content

Commit f12eb28

Browse files
CraigMacomberRafaelGSS
authored andcommitted
esm: avoid throw when module specifier is not url
This particular exception is responsible for a lot of overhead when debugging with large esm codebases with VS Code and break on caught exceptions is enabled. VS Code silently suppresses this exception, but the mechanism it uses to do so is a bit slow so avoiding this common exception can speed up loading of esm code. In my scenario this saved over have of the startup run time (over 20 seconds). This should also make debugging without suppression of this exception more pleasant in other tools such as the Chrome dev tools when attached to NodeJs processes. PR-URL: #61000 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Jacob Smith <jacob@frende.me> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
1 parent 72f42b9 commit f12eb28

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

lib/internal/modules/esm/resolve.js

Lines changed: 6 additions & 4 deletions

0 commit comments

Comments
 (0)