Commit 11f1ad93 authored by Michaël Zasso's avatar Michaël Zasso Committed by Node.js GitHub Bot
Browse files

module: only try to enrich CJS syntax errors

It is guaranteed that V8 throws a syntax error when `import` or `export`
is used outside of ESM.

Fixes: https://github.com/nodejs/node/issues/35687

PR-URL: https://github.com/nodejs/node/pull/35691


Reviewed-By: default avatarMatteo Collina <matteo.collina@gmail.com>
Reviewed-By: default avatarBenjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: default avatarRich Trott <rtrott@gmail.com>
Reviewed-By: default avatarGuy Bedford <guybedford@gmail.com>
Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
Reviewed-By: default avatarLuigi Pinca <luigipinca@gmail.com>
parent 5b2c263b
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment