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

Update: Support top-level await and regexp match indices #505

Merged
merged 10 commits into from Jun 24, 2021
Merged

Conversation

nzakas
Copy link
Member

@nzakas nzakas commented Jun 11, 2021

Updates Acorn and adds tests for top-level await and regexp match indices.

Refs eslint/eslint#14632
Refs eslint/eslint#14640

Copy link
Member

@aladdin-add aladdin-add left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

supported features in readme needs to be updated, too.
https://github.com/eslint/espree#what-ecmascript-features-do-you-support

@nzakas
Copy link
Member Author

nzakas commented Jun 14, 2021

Okay, should be all set now.

nzakas and others added 2 commits June 21, 2021 17:18
…ch-indices.result.js

Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
…ch-indices.result.js

Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Copy link
Member

@aladdin-add aladdin-add left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM!

@mdjermanovic
Copy link
Member

I think we need the top-level await tests to have modules word in the file path. Otherwise, they'll be parsed both with sourceType: "script" and sourceType: "module"

const scriptOnlyTestFiles = allTestFiles.filter(filename => !filename.includes("modules"));

(that "Only" in the variable name is misleading)

I can see this test in the output, it's passing only because the current Acorn allows that:

  ecmaVersion
    Scripts
      /13/top-level-await/top-await
        √ should parse correctly when sourceType is script

We can make a modules subdir in ecma-version/13: ecma-version/13/modules/top-level-await/, the same way as it was done in ecma-version/11

@nzakas
Copy link
Member Author

nzakas commented Jun 24, 2021

I updated the tests. I’d like to see if there’s a new Acorn release in the next couple days with the top-level await fix.

@nzakas
Copy link
Member Author

nzakas commented Jun 24, 2021

A new release of Acorn was published, so added that.

@nzakas nzakas merged commit e207bd7 into main Jun 24, 2021
@nzakas nzakas deleted the top-level-await branch June 24, 2021 18:38
@aladdin-add aladdin-add mentioned this pull request Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants