Skip to content

Commit

Permalink
Add 2025 to ecmaVersion type
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnh committed Apr 17, 2024
1 parent 9d041c4 commit 1e4161f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
11 changes: 5 additions & 6 deletions acorn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,11 @@ Options are provided by in a second argument, which should be an
object containing any of these fields (only `ecmaVersion` is
required):

- **ecmaVersion**: Indicates the ECMAScript version to parse. Must be
either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10 (2019),
11 (2020), 12 (2021), 13 (2022), 14 (2023), or `"latest"` (the
latest the library supports). This influences support for strict
mode, the set of reserved words, and support for new syntax
features.
- **ecmaVersion**: Indicates the ECMAScript version to parse. Can be a
number, either in year (`2022`) or plain version number (`6`) form,
or `"latest"` (the latest the library supports). This influences
support for strict mode, the set of reserved words, and support for
new syntax features.

**NOTE**: Only 'stage 4' (finalized) ECMAScript features are being
implemented by Acorn. Other proposed new features must be
Expand Down
13 changes: 6 additions & 7 deletions acorn/src/acorn.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -573,16 +573,15 @@ export function tokenizer(input: string, options: Options): {
[Symbol.iterator](): Iterator<Token>
}

export type ecmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | "latest"
export type ecmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | 2025 | "latest"

export interface Options {
/**
* `ecmaVersion` indicates the ECMAScript version to parse. Must be
* either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10
* (2019), 11 (2020), 12 (2021), 13 (2022), 14 (2023), or `"latest"`
* (the latest version the library supports). This influences
* support for strict mode, the set of reserved words, and support
* for new syntax features.
* `ecmaVersion` indicates the ECMAScript version to parse. Can be a
* number, either in year (`2022`) or plain version number (`6`) form,
* or `"latest"` (the latest the library supports). This influences
* support for strict mode, the set of reserved words, and support for
* new syntax features.
*/
ecmaVersion: ecmaVersion

Expand Down

0 comments on commit 1e4161f

Please sign in to comment.