Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module: only try to enrich CJS syntax errors #35691

Closed
wants to merge 1 commit into from
Closed

Conversation

targos
Copy link
Member

@targos targos commented Oct 17, 2020

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

Fixes: #35687

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

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

Fixes: nodejs#35687
@nodejs-github-bot
Copy link
Contributor

@nodejs-github-bot nodejs-github-bot commented Oct 17, 2020

Review requested:

@nodejs-github-bot nodejs-github-bot added the esm label Oct 17, 2020
@targos targos added the request-ci label Oct 17, 2020
@targos
Copy link
Member Author

@targos targos commented Oct 17, 2020

The output is not ideal, but that is not new:

$ ./node test/fixtures/es-modules/es-note-error-3.mjs

node:internal/process/esm_loader:74
    internalBinding('errors').triggerUncaughtException(
                              ^
null
(Use `node --trace-uncaught ...` to show where the exception was thrown)

Copy link
Member

@mcollina mcollina left a comment

lgtm

Copy link
Member

@mcollina mcollina left a comment

lgtm

@github-actions github-actions bot removed the request-ci label Oct 17, 2020
@nodejs-github-bot

This comment has been hidden.

Trott
Trott approved these changes Oct 17, 2020
Copy link
Member

@Trott Trott left a comment

Nit: Commit message should start with a verb. Maybe this?

module: enrich only CJS syntax errors

@nodejs-github-bot
Copy link
Contributor

@nodejs-github-bot nodejs-github-bot commented Oct 18, 2020

@aduh95 aduh95 added the author ready label Oct 18, 2020
lpinca
lpinca approved these changes Oct 18, 2020
@aduh95 aduh95 added the commit-queue label Oct 19, 2020
@github-actions github-actions bot removed the commit-queue label Oct 19, 2020
@github-actions
Copy link

@github-actions github-actions bot commented Oct 19, 2020

Landed in 5b2c263...11f1ad9

@github-actions github-actions bot closed this Oct 19, 2020
nodejs-github-bot added a commit that referenced this issue Oct 19, 2020
It is guaranteed that V8 throws a syntax error when `import` or `export`
is used outside of ESM.

Fixes: #35687

PR-URL: #35691
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
MylesBorins added a commit that referenced this issue Nov 3, 2020
It is guaranteed that V8 throws a syntax error when `import` or `export`
is used outside of ESM.

Fixes: #35687

PR-URL: #35691
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Nov 3, 2020
BethGriggs added a commit that referenced this issue Dec 8, 2020
It is guaranteed that V8 throws a syntax error when `import` or `export`
is used outside of ESM.

Fixes: #35687

PR-URL: #35691
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
BethGriggs added a commit that referenced this issue Dec 10, 2020
It is guaranteed that V8 throws a syntax error when `import` or `export`
is used outside of ESM.

Fixes: #35687

PR-URL: #35691
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@BethGriggs BethGriggs mentioned this pull request Dec 10, 2020
BethGriggs added a commit that referenced this issue Dec 15, 2020
It is guaranteed that V8 throws a syntax error when `import` or `export`
is used outside of ESM.

Fixes: #35687

PR-URL: #35691
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@targos targos deleted the fix-35687 branch Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready esm
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

9 participants