diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index c3f3af69..121d264c 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -27,7 +27,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
- node: [23.x, 22.x, 21.x, 20.x, 18.x, "18.18.0"]
+ node: [24.x, 22.x, 20.x, 18.x, "18.18.0"]
include:
- os: windows-latest
node: "lts/*"
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 8fc408ad..6a296d6a 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,5 +1,5 @@
{
- "packages/espree": "10.3.0",
- "packages/eslint-scope": "8.3.0",
- "packages/eslint-visitor-keys": "4.2.0"
+ "packages/espree": "10.4.0",
+ "packages/eslint-scope": "8.4.0",
+ "packages/eslint-visitor-keys": "4.2.1"
}
diff --git a/README.md b/README.md
index 116a62e5..5308fa4a 100644
--- a/README.md
+++ b/README.md
@@ -21,11 +21,12 @@ We work hard to ensure that the packages inside this repository are safe for eve
The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
to get your logo on our READMEs and [website](https://eslint.org/sponsors).
-
Platinum Sponsors
+Diamond Sponsors
+
Platinum Sponsors

Gold Sponsors

Silver Sponsors
-

Bronze Sponsors
-

+

Bronze Sponsors
+

Technology Sponsors
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

diff --git a/package.json b/package.json
index 5e715a54..9ab83203 100644
--- a/package.json
+++ b/package.json
@@ -22,12 +22,14 @@
]
},
"devDependencies": {
+ "c8": "^10.1.3",
"eslint": "^9.11.1",
"eslint-config-eslint": "^11.0.0",
"eslint-plugin-chai-friendly": "^1.0.0",
"globals": "^15.1.0",
"got": "^14.4.1",
"lint-staged": "^15.2.0",
+ "mocha": "^11.1.0",
"yorkie": "^2.0.0"
}
}
diff --git a/packages/eslint-scope/CHANGELOG.md b/packages/eslint-scope/CHANGELOG.md
index fc5f1f85..c8c5b258 100644
--- a/packages/eslint-scope/CHANGELOG.md
+++ b/packages/eslint-scope/CHANGELOG.md
@@ -1,5 +1,20 @@
# Changelog
+## [8.4.0](https://github.com/eslint/js/compare/eslint-scope-v8.3.0...eslint-scope-v8.4.0) (2025-06-09)
+
+
+### Features
+
+* Add support for ES2026 `using` and `await using` declarations ([#658](https://github.com/eslint/js/issues/658)) ([39e0865](https://github.com/eslint/js/commit/39e086509a0164dcea960719fb9673c73452f36e))
+
+
+### Dependencies
+
+* The following workspace dependencies were updated
+ * devDependencies
+ * eslint-visitor-keys bumped from ^4.2.0 to ^4.2.1
+ * espree bumped from ^10.3.0 to ^10.4.0
+
## [8.3.0](https://github.com/eslint/js/compare/eslint-scope-v8.2.0...eslint-scope-v8.3.0) (2025-03-07)
diff --git a/packages/eslint-scope/README.md b/packages/eslint-scope/README.md
index 2896d81e..e5b6a24a 100644
--- a/packages/eslint-scope/README.md
+++ b/packages/eslint-scope/README.md
@@ -74,6 +74,94 @@ estraverse.traverse(ast, {
});
```
+## API
+
+The following section describes the API for this package. You can also read [the docs](https://eslint.org/docs/latest/extend/scope-manager-interface).
+
+### ScopeManager
+
+The `ScopeManager` class is at the core of eslint-scope and is returned when you call `eslintScope.analyze()`. It manages all scopes in a given AST.
+
+#### Properties
+
+- `scopes` - An array of all scopes.
+- `globalScope` - Reference to the global scope.
+
+#### Methods
+
+- **`acquire(node, inner)`**
+ Acquires the appropriate scope for a given node.
+ - `node` - The AST node to acquire the scope from.
+ - `inner` - Optional boolean. When `true`, returns the innermost scope, otherwise returns the outermost scope. Default is `false`.
+ - Returns: The acquired scope or `null` if no scope is found.
+
+- **`acquireAll(node)`**
+ Acquires all scopes for a given node.
+ - `node` - The AST node to acquire scopes from.
+ - Returns: An array of scopes or `undefined` if none are found.
+
+- **`release(node, inner)`**
+ Returns the upper scope for a given node.
+ - `node` - The AST node to release.
+ - `inner` - Optional boolean. When `true`, returns the innermost upper scope, otherwise returns the outermost upper scope. Default is `false`.
+ - Returns: The upper scope or `null` if no upper scope exists.
+
+- **`getDeclaredVariables(node)`**
+ Get variables that are declared by the node.
+ - `node` - The AST node to get declarations from.
+ - Returns: An array of variable objects declared by the node. If the node doesn't declare any variables, it returns an empty array.
+
+- **`isGlobalReturn()`**
+ Determines if the global return statement should be allowed.
+ - Returns: `true` if the global return is enabled.
+
+- **`isModule()`**
+ Checks if the code should be handled as an ECMAScript module.
+ - Returns: `true` if the sourceType is "module".
+
+- **`isImpliedStrict()`**
+ Checks if implied strict mode is enabled.
+ - Returns: `true` if implied strict mode is enabled.
+
+- **`isStrictModeSupported()`**
+ Checks if strict mode is supported based on ECMAScript version.
+ - Returns: `true` if the ECMAScript version supports strict mode.
+
+### Scope Objects
+
+Scopes returned by the ScopeManager methods have the following properties:
+
+- `type` - The type of scope (e.g., "function", "block", "global").
+- `variables` - Array of variables declared in this scope.
+- `set` - A Map of variable names to Variable objects for variables declared in this scope.
+- `references` - Array of references in this scope.
+- `through` - Array of references in this scope and its child scopes that aren't resolved in this scope or its child scopes.
+- `variableScope` - Reference to the closest variable scope.
+- `upper` - Reference to the parent scope.
+- `childScopes` - Array of child scopes.
+- `block` - The AST node that created this scope.
+
+### GlobalScope
+
+The `GlobalScope` class is a specialized scope representing the global execution context. It extends the base `Scope` class with additional functionality for handling implicitly defined global variables.
+
+#### Properties
+
+- **`implicit`** - Tracks implicitly defined global variables (those used without declaration).
+ - `set` - A Map of variable names to Variable objects for implicitly defined globals.
+ - `variables` - Array of implicit global Variable objects.
+ - `left` - Array of References that need to be linked to the variable they refer to.
+
+### Variable Objects
+
+Each variable object has the following properties:
+
+- `name` - The variable name.
+- `identifiers` - Array of identifier nodes declaring this variable.
+- `references` - Array of references to this variable.
+- `defs` - Array of definition objects for this variable.
+- `scope` - The scope object where this variable is defined.
+
## Contributing
Issues and pull requests will be triaged and responded to as quickly as possible. We operate under the [ESLint Contributor Guidelines](http://eslint.org/docs/developer-guide/contributing), so please be sure to read them before contributing. If you're not sure where to dig in, check out the [issues](https://github.com/eslint/js/issues).
@@ -98,11 +186,12 @@ ESLint Scope is licensed under a permissive BSD 2-clause license.
The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
to get your logo on our READMEs and [website](https://eslint.org/sponsors).
-Platinum Sponsors
+Diamond Sponsors
+
Platinum Sponsors

Gold Sponsors

Silver Sponsors
-

Bronze Sponsors
-

+

Bronze Sponsors
+

Technology Sponsors
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

diff --git a/packages/eslint-scope/package.json b/packages/eslint-scope/package.json
index 5d7a1977..e634e45b 100644
--- a/packages/eslint-scope/package.json
+++ b/packages/eslint-scope/package.json
@@ -11,12 +11,19 @@
},
"./package.json": "./package.json"
},
- "version": "8.3.0",
+ "version": "8.4.0",
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
- "repository": "eslint/js",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/eslint/js.git",
+ "directory": "packages/eslint-scope"
+ },
"funding": "https://opencollective.com/eslint",
+ "keywords": [
+ "eslint"
+ ],
"bugs": {
"url": "https://github.com/eslint/js/issues"
},
@@ -45,12 +52,10 @@
},
"devDependencies": {
"@typescript-eslint/parser": "^8.7.0",
- "c8": "^7.7.3",
"chai": "^4.3.4",
"eslint-release": "^3.2.0",
- "eslint-visitor-keys": "^4.2.0",
- "espree": "^10.3.0",
- "mocha": "^9.0.1",
+ "eslint-visitor-keys": "^4.2.1",
+ "espree": "^10.4.0",
"npm-license": "^0.3.3",
"rollup": "^2.52.7",
"shelljs": "^0.8.5",
diff --git a/packages/eslint-scope/tests/using-scope.js b/packages/eslint-scope/tests/using-scope.js
new file mode 100644
index 00000000..0a6c7882
--- /dev/null
+++ b/packages/eslint-scope/tests/using-scope.js
@@ -0,0 +1,69 @@
+/**
+ * @fileoverview Tests for ES2026 `using` and `await using`.
+ * @author Yosuke Ota
+ */
+
+import { expect } from "chai";
+import * as espree from "espree";
+import { analyze } from "../lib/index.js";
+
+describe("`using` and `await using` block scope", () => {
+ it("`using` in block scope", () => {
+ const ast = espree.parse(`
+ {
+ using i = 42;
+ i;
+ }
+ `, { ecmaVersion: 2026 });
+
+ const scopeManager = analyze(ast, { ecmaVersion: 2026 });
+
+ expect(scopeManager.scopes).to.have.length(2); // Program and BlockStatement scope.
+
+ let scope = scopeManager.scopes[0];
+
+ expect(scope.type).to.be.equal("global");
+ expect(scope.variables).to.have.length(0);
+
+ scope = scopeManager.scopes[1];
+ expect(scope.type).to.be.equal("block");
+ expect(scope.variables).to.have.length(1);
+ expect(scope.variables[0].name).to.be.equal("i");
+ expect(scope.references).to.have.length(2);
+ expect(scope.references[0].identifier.name).to.be.equal("i");
+ expect(scope.references[1].identifier.name).to.be.equal("i");
+ });
+ it("`await using` in block scope", () => {
+ const ast = espree.parse(`
+ async function fn() {
+ {
+ await using i = 42;
+ i;
+ }
+ }
+ `, { ecmaVersion: 2026 });
+
+ const scopeManager = analyze(ast, { ecmaVersion: 2026 });
+
+ expect(scopeManager.scopes).to.have.length(3); // Program, Function, and BlockStatement scope.
+
+ let scope = scopeManager.scopes[0];
+
+ expect(scope.type).to.be.equal("global");
+ expect(scope.variables).to.have.length(1);
+ expect(scope.variables[0].name).to.be.equal("fn");
+
+ scope = scopeManager.scopes[1];
+ expect(scope.type).to.be.equal("function");
+ expect(scope.variables).to.have.length(1);
+ expect(scope.variables[0].name).to.be.equal("arguments");
+
+ scope = scopeManager.scopes[2];
+ expect(scope.type).to.be.equal("block");
+ expect(scope.variables).to.have.length(1);
+ expect(scope.variables[0].name).to.be.equal("i");
+ expect(scope.references).to.have.length(2);
+ expect(scope.references[0].identifier.name).to.be.equal("i");
+ expect(scope.references[1].identifier.name).to.be.equal("i");
+ });
+});
diff --git a/packages/eslint-visitor-keys/CHANGELOG.md b/packages/eslint-visitor-keys/CHANGELOG.md
index ac62fe31..8647806e 100644
--- a/packages/eslint-visitor-keys/CHANGELOG.md
+++ b/packages/eslint-visitor-keys/CHANGELOG.md
@@ -1,5 +1,12 @@
# Changelog
+## [4.2.1](https://github.com/eslint/js/compare/eslint-visitor-keys-v4.2.0...eslint-visitor-keys-v4.2.1) (2025-06-09)
+
+
+### Bug Fixes
+
+* order visitor keys for `ExportSpecifier` in source code order ([#656](https://github.com/eslint/js/issues/656)) ([dbad7d8](https://github.com/eslint/js/commit/dbad7d8aeab3f24253ab846f1247a33b7ddd0f19))
+
## [4.2.0](https://github.com/eslint/js/compare/eslint-visitor-keys-v4.1.0...eslint-visitor-keys-v4.2.0) (2024-10-29)
diff --git a/packages/eslint-visitor-keys/README.md b/packages/eslint-visitor-keys/README.md
index 3bb0e93b..aa860ba5 100644
--- a/packages/eslint-visitor-keys/README.md
+++ b/packages/eslint-visitor-keys/README.md
@@ -109,11 +109,12 @@ Welcome. See [ESLint contribution guidelines](https://eslint.org/docs/developer-
The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
to get your logo on our READMEs and [website](https://eslint.org/sponsors).
-Platinum Sponsors
+Diamond Sponsors
+
Platinum Sponsors

Gold Sponsors

Silver Sponsors
-

Bronze Sponsors
-

+

Bronze Sponsors
+

Technology Sponsors
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

diff --git a/packages/eslint-visitor-keys/lib/visitor-keys.js b/packages/eslint-visitor-keys/lib/visitor-keys.js
index 41feb4b2..c891e040 100644
--- a/packages/eslint-visitor-keys/lib/visitor-keys.js
+++ b/packages/eslint-visitor-keys/lib/visitor-keys.js
@@ -100,8 +100,8 @@ const KEYS = {
"attributes"
],
ExportSpecifier: [
- "exported",
- "local"
+ "local",
+ "exported"
],
ExpressionStatement: [
"expression"
diff --git a/packages/eslint-visitor-keys/package.json b/packages/eslint-visitor-keys/package.json
index 4dc2123d..852e4ddb 100644
--- a/packages/eslint-visitor-keys/package.json
+++ b/packages/eslint-visitor-keys/package.json
@@ -1,6 +1,6 @@
{
"name": "eslint-visitor-keys",
- "version": "4.2.0",
+ "version": "4.2.1",
"description": "Constants and utilities about visitor keys to traverse AST.",
"type": "module",
"main": "dist/eslint-visitor-keys.cjs",
@@ -29,12 +29,9 @@
"@types/estree": "^0.0.51",
"@types/estree-jsx": "^0.0.1",
"@typescript-eslint/parser": "^8.7.0",
- "c8": "^7.11.0",
- "chai": "^4.3.6",
"eslint-release": "^3.2.0",
"esquery": "^1.4.0",
"json-diff": "^0.7.3",
- "mocha": "^9.2.1",
"opener": "^1.5.2",
"rollup": "^4.22.4",
"rollup-plugin-dts": "^6.1.1",
@@ -55,9 +52,15 @@
"test:open-coverage": "c8 report --reporter lcov && opener coverage/lcov-report/index.html",
"test:types": "tsd"
},
- "repository": "eslint/js",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/eslint/js.git",
+ "directory": "packages/eslint-visitor-keys"
+ },
"funding": "https://opencollective.com/eslint",
- "keywords": [],
+ "keywords": [
+ "eslint"
+ ],
"author": "Toru Nagashima (https://github.com/mysticatea)",
"license": "Apache-2.0",
"bugs": {
diff --git a/packages/espree/CHANGELOG.md b/packages/espree/CHANGELOG.md
index dc5b5738..37db6833 100644
--- a/packages/espree/CHANGELOG.md
+++ b/packages/espree/CHANGELOG.md
@@ -1,5 +1,19 @@
# Changelog
+## [10.4.0](https://github.com/eslint/js/compare/espree-v10.3.0...espree-v10.4.0) (2025-06-09)
+
+
+### Features
+
+* Add support for ES2026 `using` and `await using` declarations ([#658](https://github.com/eslint/js/issues/658)) ([39e0865](https://github.com/eslint/js/commit/39e086509a0164dcea960719fb9673c73452f36e))
+
+
+### Dependencies
+
+* The following workspace dependencies were updated
+ * dependencies
+ * eslint-visitor-keys bumped from ^4.2.0 to ^4.2.1
+
## [10.3.0](https://github.com/eslint/js/compare/espree-v10.2.0...espree-v10.3.0) (2024-10-29)
diff --git a/packages/espree/README.md b/packages/espree/README.md
index 22e3c7e8..e8e73ee5 100644
--- a/packages/espree/README.md
+++ b/packages/espree/README.md
@@ -140,8 +140,8 @@ const options = {
// create a top-level tokens array containing all tokens
tokens: false,
- // Set to 3, 5 (the default), 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 or 16 to specify the version of ECMAScript syntax you want to use.
- // You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), 2019 (same as 10), 2020 (same as 11), 2021 (same as 12), 2022 (same as 13), 2023 (same as 14), 2024 (same as 15) or 2025 (same as 16) to use the year-based naming.
+ // Set to 3, 5 (the default), 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 or 17 to specify the version of ECMAScript syntax you want to use.
+ // You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), 2019 (same as 10), 2020 (same as 11), 2021 (same as 12), 2022 (same as 13), 2023 (same as 14), 2024 (same as 15), 2025 (same as 16) or 2026 (same as 17) to use the year-based naming.
// You can also set "latest" to use the most recently supported version.
ecmaVersion: 3,
@@ -231,13 +231,11 @@ We are building on top of Acorn, however, so that we can contribute back and hel
### What ECMAScript features do you support?
-Espree supports all ECMAScript 2024 features and partially supports ECMAScript 2025 features.
+Espree supports all ECMAScript 2025 features and partially supports ECMAScript 2026 features.
-Because ECMAScript 2025 is still under development, we are implementing features as they are finalized. Currently, Espree supports:
+Because ECMAScript 2026 is still under development, we are implementing features as they are finalized. Currently, Espree supports:
-* [RegExp Duplicate named capturing groups](https://github.com/tc39/proposal-duplicate-named-capturing-groups)
-* [RegExp Pattern modifiers](https://github.com/tc39/proposal-regexp-modifiers)
-* [Import Attributes](https://github.com/tc39/proposal-import-attributes)
+* [Explicit Resource Management](https://github.com/tc39/proposal-explicit-resource-management)
See [finished-proposals.md](https://github.com/tc39/proposals/blob/master/finished-proposals.md) to know what features are finalized.
@@ -252,11 +250,12 @@ In general, we do not support experimental JavaScript features. We may make exce
The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
to get your logo on our READMEs and [website](https://eslint.org/sponsors).
-Platinum Sponsors
+Diamond Sponsors
+
Platinum Sponsors

Gold Sponsors

Silver Sponsors
-

Bronze Sponsors
-

+

Bronze Sponsors
+

Technology Sponsors
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

diff --git a/packages/espree/docs/README.md b/packages/espree/docs/README.md
index cacb72e3..550a4975 100644
--- a/packages/espree/docs/README.md
+++ b/packages/espree/docs/README.md
@@ -140,8 +140,8 @@ const options = {
// create a top-level tokens array containing all tokens
tokens: false,
- // Set to 3, 5 (the default), 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 or 16 to specify the version of ECMAScript syntax you want to use.
- // You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), 2019 (same as 10), 2020 (same as 11), 2021 (same as 12), 2022 (same as 13), 2023 (same as 14), 2024 (same as 15) or 2025 (same as 16) to use the year-based naming.
+ // Set to 3, 5 (the default), 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 or 17 to specify the version of ECMAScript syntax you want to use.
+ // You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), 2019 (same as 10), 2020 (same as 11), 2021 (same as 12), 2022 (same as 13), 2023 (same as 14), 2024 (same as 15), 2025 (same as 16) or 2026 (same as 17) to use the year-based naming.
// You can also set "latest" to use the most recently supported version.
ecmaVersion: 3,
@@ -231,13 +231,11 @@ We are building on top of Acorn, however, so that we can contribute back and hel
### What ECMAScript features do you support?
-Espree supports all ECMAScript 2024 features and partially supports ECMAScript 2025 features.
+Espree supports all ECMAScript 2025 features and partially supports ECMAScript 2026 features.
-Because ECMAScript 2025 is still under development, we are implementing features as they are finalized. Currently, Espree supports:
+Because ECMAScript 2026 is still under development, we are implementing features as they are finalized. Currently, Espree supports:
-* [RegExp Duplicate named capturing groups](https://github.com/tc39/proposal-duplicate-named-capturing-groups)
-* [RegExp Pattern modifiers](https://github.com/tc39/proposal-regexp-modifiers)
-* [Import Attributes](https://github.com/tc39/proposal-import-attributes)
+* [Explicit Resource Management](https://github.com/tc39/proposal-explicit-resource-management)
See [finished-proposals.md](https://github.com/tc39/proposals/blob/master/finished-proposals.md) to know what features are finalized.
diff --git a/packages/espree/lib/options.js b/packages/espree/lib/options.js
index 2cdfb689..85bb9029 100644
--- a/packages/espree/lib/options.js
+++ b/packages/espree/lib/options.js
@@ -20,7 +20,8 @@ const SUPPORTED_VERSIONS = [
13, // 2022
14, // 2023
15, // 2024
- 16 // 2025
+ 16, // 2025
+ 17 // 2026
];
/**
diff --git a/packages/espree/package.json b/packages/espree/package.json
index ca08d881..20b6dc6f 100644
--- a/packages/espree/package.json
+++ b/packages/espree/package.json
@@ -16,7 +16,7 @@
],
"./package.json": "./package.json"
},
- "version": "10.3.0",
+ "version": "10.4.0",
"files": [
"lib",
"dist/espree.cjs",
@@ -25,25 +25,27 @@
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
- "repository": "eslint/js",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/eslint/js.git",
+ "directory": "packages/espree"
+ },
"bugs": {
"url": "https://github.com/eslint/js/issues"
},
"funding": "https://opencollective.com/eslint",
"license": "BSD-2-Clause",
"dependencies": {
- "acorn": "^8.14.0",
+ "acorn": "^8.15.0",
"acorn-jsx": "^5.3.2",
- "eslint-visitor-keys": "^4.2.0"
+ "eslint-visitor-keys": "^4.2.1"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^28.0.0",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.3.0",
- "c8": "^7.11.0",
"eslint-release": "^3.2.0",
"esprima-fb": "^8001.2001.0-dev-harmony-fb",
- "mocha": "^9.2.2",
"npm-run-all2": "^6.2.2",
"rollup": "^2.79.1",
"shelljs": "^0.8.5"
@@ -70,6 +72,6 @@
"release:publish": "eslint-publish-release",
"test": "npm-run-all -s test:*",
"test:cjs": "mocha --color --reporter progress --timeout 30000 tests/lib/commonjs.cjs",
- "test:esm": "c8 mocha --color --reporter progress --timeout 30000 'tests/lib/**/*.js'"
+ "test:esm": "c8 mocha --color --reporter progress --timeout 30000 tests/lib/**/*.js"
}
}
diff --git a/packages/espree/tests/fixtures/ecma-version/11/bigint/binary.result.js b/packages/espree/tests/fixtures/ecma-version/11/bigint/binary.result.js
index 28ceccf8..ad06c8b8 100644
--- a/packages/espree/tests/fixtures/ecma-version/11/bigint/binary.result.js
+++ b/packages/espree/tests/fixtures/ecma-version/11/bigint/binary.result.js
@@ -49,7 +49,7 @@ export default {
],
"value": 0b0101n,
"raw": "0b0101n",
- "bigint": "0b0101"
+ "bigint": "5"
}
}
],
diff --git a/packages/espree/tests/fixtures/ecma-version/11/bigint/hex.result.js b/packages/espree/tests/fixtures/ecma-version/11/bigint/hex.result.js
index f491018f..c483025b 100644
--- a/packages/espree/tests/fixtures/ecma-version/11/bigint/hex.result.js
+++ b/packages/espree/tests/fixtures/ecma-version/11/bigint/hex.result.js
@@ -49,7 +49,7 @@ export default {
],
"value": 0x80n,
"raw": "0x80n",
- "bigint": "0x80"
+ "bigint": "128"
}
}
],
diff --git a/packages/espree/tests/fixtures/ecma-version/11/bigint/octal.result.js b/packages/espree/tests/fixtures/ecma-version/11/bigint/octal.result.js
index 73ccb7ee..36bc8307 100644
--- a/packages/espree/tests/fixtures/ecma-version/11/bigint/octal.result.js
+++ b/packages/espree/tests/fixtures/ecma-version/11/bigint/octal.result.js
@@ -49,7 +49,7 @@ export default {
],
"value": 0o755n,
"raw": "0o755n",
- "bigint": "0o755"
+ "bigint": "493"
}
}
],
diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-export-using.module-result.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-export-using.module-result.js
new file mode 100644
index 00000000..814cccb6
--- /dev/null
+++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-export-using.module-result.js
@@ -0,0 +1,6 @@
+export default {
+ "index": 7,
+ "lineNumber": 1,
+ "column": 8,
+ "message": "Unexpected token using"
+};
\ No newline at end of file
diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-export-using.result.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-export-using.result.js
new file mode 100644
index 00000000..521323ed
--- /dev/null
+++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-export-using.result.js
@@ -0,0 +1,6 @@
+export default {
+ "index": 0,
+ "lineNumber": 1,
+ "column": 1,
+ "message": "'import' and 'export' may appear only with 'sourceType: module'"
+};
\ No newline at end of file
diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-export-using.src.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-export-using.src.js
new file mode 100644
index 00000000..f84b83dc
--- /dev/null
+++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-export-using.src.js
@@ -0,0 +1 @@
+export using x = foo();
diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-let.module-result.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-let.module-result.js
new file mode 100644
index 00000000..a47cb2f1
--- /dev/null
+++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-let.module-result.js
@@ -0,0 +1,6 @@
+export default {
+ "index": 8,
+ "lineNumber": 1,
+ "column": 9,
+ "message": "The keyword 'let' is reserved"
+};
\ No newline at end of file
diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-let.result.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-let.result.js
new file mode 100644
index 00000000..638bbacf
--- /dev/null
+++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-let.result.js
@@ -0,0 +1,6 @@
+export default {
+ "index": 8,
+ "lineNumber": 1,
+ "column": 9,
+ "message": "let is disallowed as a lexically bound name"
+};
\ No newline at end of file
diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-let.src.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-let.src.js
new file mode 100644
index 00000000..09f110a6
--- /dev/null
+++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-let.src.js
@@ -0,0 +1 @@
+{ using let = x; }
diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-with-object-pattern.result.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-with-object-pattern.result.js
new file mode 100644
index 00000000..946c71cf
--- /dev/null
+++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-with-object-pattern.result.js
@@ -0,0 +1,6 @@
+export default {
+ "index": 8,
+ "lineNumber": 1,
+ "column": 9,
+ "message": "Unexpected token {"
+};
\ No newline at end of file
diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-with-object-pattern.src.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-with-object-pattern.src.js
new file mode 100644
index 00000000..20aa7ac0
--- /dev/null
+++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-with-object-pattern.src.js
@@ -0,0 +1 @@
+{ using {x} = obj; }
diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-without-init-multi.result.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-without-init-multi.result.js
new file mode 100644
index 00000000..3629d2bf
--- /dev/null
+++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-without-init-multi.result.js
@@ -0,0 +1,6 @@
+export default {
+ "index": 20,
+ "lineNumber": 1,
+ "column": 21,
+ "message": "Missing initializer in using declaration"
+};
\ No newline at end of file
diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-without-init-multi.src.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-without-init-multi.src.js
new file mode 100644
index 00000000..7c9c3325
--- /dev/null
+++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-without-init-multi.src.js
@@ -0,0 +1 @@
+{ using x = foo(), y; }
diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-without-init.result.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-without-init.result.js
new file mode 100644
index 00000000..9043beaf
--- /dev/null
+++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-without-init.result.js
@@ -0,0 +1,6 @@
+export default {
+ "index": 9,
+ "lineNumber": 1,
+ "column": 10,
+ "message": "Missing initializer in using declaration"
+};
\ No newline at end of file
diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-without-init.src.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-without-init.src.js
new file mode 100644
index 00000000..80ea3570
--- /dev/null
+++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-without-init.src.js
@@ -0,0 +1 @@
+{ using x; }
diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-not-using.result.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-not-using.result.js
new file mode 100644
index 00000000..133ef4da
--- /dev/null
+++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-not-using.result.js
@@ -0,0 +1,1630 @@
+export default {
+ "type": "Program",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 12,
+ "column": 10
+ }
+ },
+ "range": [
+ 73,
+ 324
+ ],
+ "body": [
+ {
+ "type": "BlockStatement",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "range": [
+ 73,
+ 96
+ ],
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "range": [
+ 75,
+ 94
+ ],
+ "expression": {
+ "type": "AssignmentExpression",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "range": [
+ 75,
+ 93
+ ],
+ "operator": "=",
+ "left": {
+ "type": "MemberExpression",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "range": [
+ 75,
+ 87
+ ],
+ "object": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "range": [
+ 75,
+ 80
+ ],
+ "name": "using"
+ },
+ "property": {
+ "type": "SequenceExpression",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "range": [
+ 82,
+ 86
+ ],
+ "expressions": [
+ {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "range": [
+ 82,
+ 83
+ ],
+ "name": "a"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "range": [
+ 85,
+ 86
+ ],
+ "name": "b"
+ }
+ ]
+ },
+ "computed": true,
+ "optional": false
+ },
+ "right": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "range": [
+ 90,
+ 93
+ ],
+ "name": "arr"
+ }
+ }
+ }
+ ]
+ },
+ {
+ "type": "BlockStatement",
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 16
+ }
+ },
+ "range": [
+ 125,
+ 149
+ ],
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 7
+ }
+ },
+ "range": [
+ 127,
+ 132
+ ],
+ "expression": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 7
+ }
+ },
+ "range": [
+ 127,
+ 132
+ ],
+ "name": "using"
+ }
+ },
+ {
+ "type": "ExpressionStatement",
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 14
+ }
+ },
+ "range": [
+ 137,
+ 147
+ ],
+ "expression": {
+ "type": "AssignmentExpression",
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 13
+ }
+ },
+ "range": [
+ 137,
+ 146
+ ],
+ "operator": "=",
+ "left": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 5
+ }
+ },
+ "range": [
+ 137,
+ 138
+ ],
+ "name": "x"
+ },
+ "right": {
+ "type": "CallExpression",
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 13
+ }
+ },
+ "range": [
+ 141,
+ 146
+ ],
+ "callee": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 11
+ }
+ },
+ "range": [
+ 141,
+ 144
+ ],
+ "name": "foo"
+ },
+ "arguments": [],
+ "optional": false
+ }
+ }
+ }
+ ]
+ },
+ {
+ "type": "FunctionDeclaration",
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 1
+ }
+ },
+ "range": [
+ 175,
+ 264
+ ],
+ "id": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 15
+ },
+ "end": {
+ "line": 5,
+ "column": 17
+ }
+ },
+ "range": [
+ 190,
+ 192
+ ],
+ "name": "fn"
+ },
+ "expression": false,
+ "generator": false,
+ "async": true,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 20
+ },
+ "end": {
+ "line": 8,
+ "column": 1
+ }
+ },
+ "range": [
+ 195,
+ 264
+ ],
+ "body": [
+ {
+ "type": "BlockStatement",
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 4
+ },
+ "end": {
+ "line": 7,
+ "column": 20
+ }
+ },
+ "range": [
+ 201,
+ 235
+ ],
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 6
+ },
+ "end": {
+ "line": 6,
+ "column": 17
+ }
+ },
+ "range": [
+ 203,
+ 214
+ ],
+ "expression": {
+ "type": "AwaitExpression",
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 6
+ },
+ "end": {
+ "line": 6,
+ "column": 17
+ }
+ },
+ "range": [
+ 203,
+ 214
+ ],
+ "argument": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 12
+ },
+ "end": {
+ "line": 6,
+ "column": 17
+ }
+ },
+ "range": [
+ 209,
+ 214
+ ],
+ "name": "using"
+ }
+ }
+ },
+ {
+ "type": "ExpressionStatement",
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 8
+ },
+ "end": {
+ "line": 7,
+ "column": 18
+ }
+ },
+ "range": [
+ 223,
+ 233
+ ],
+ "expression": {
+ "type": "AssignmentExpression",
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 8
+ },
+ "end": {
+ "line": 7,
+ "column": 17
+ }
+ },
+ "range": [
+ 223,
+ 232
+ ],
+ "operator": "=",
+ "left": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 8
+ },
+ "end": {
+ "line": 7,
+ "column": 9
+ }
+ },
+ "range": [
+ 223,
+ 224
+ ],
+ "name": "x"
+ },
+ "right": {
+ "type": "CallExpression",
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 12
+ },
+ "end": {
+ "line": 7,
+ "column": 17
+ }
+ },
+ "range": [
+ 227,
+ 232
+ ],
+ "callee": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 12
+ },
+ "end": {
+ "line": 7,
+ "column": 15
+ }
+ },
+ "range": [
+ 227,
+ 230
+ ],
+ "name": "foo"
+ },
+ "arguments": [],
+ "optional": false
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ },
+ {
+ "type": "ForOfStatement",
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 23
+ }
+ },
+ "range": [
+ 290,
+ 313
+ ],
+ "await": false,
+ "left": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 5
+ },
+ "end": {
+ "line": 11,
+ "column": 10
+ }
+ },
+ "range": [
+ 295,
+ 300
+ ],
+ "name": "using"
+ },
+ "right": {
+ "type": "CallExpression",
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 14
+ },
+ "end": {
+ "line": 11,
+ "column": 19
+ }
+ },
+ "range": [
+ 304,
+ 309
+ ],
+ "callee": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 14
+ },
+ "end": {
+ "line": 11,
+ "column": 17
+ }
+ },
+ "range": [
+ 304,
+ 307
+ ],
+ "name": "foo"
+ },
+ "arguments": [],
+ "optional": false
+ },
+ "body": {
+ "type": "BlockStatement",
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 21
+ },
+ "end": {
+ "line": 11,
+ "column": 23
+ }
+ },
+ "range": [
+ 311,
+ 313
+ ],
+ "body": []
+ }
+ },
+ {
+ "type": "ExpressionStatement",
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 0
+ },
+ "end": {
+ "line": 12,
+ "column": 10
+ }
+ },
+ "range": [
+ 314,
+ 324
+ ],
+ "expression": {
+ "type": "AssignmentExpression",
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 0
+ },
+ "end": {
+ "line": 12,
+ "column": 9
+ }
+ },
+ "range": [
+ 314,
+ 323
+ ],
+ "operator": "=",
+ "left": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 0
+ },
+ "end": {
+ "line": 12,
+ "column": 5
+ }
+ },
+ "range": [
+ 314,
+ 319
+ ],
+ "name": "using"
+ },
+ "right": {
+ "type": "Literal",
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 8
+ },
+ "end": {
+ "line": 12,
+ "column": 9
+ }
+ },
+ "range": [
+ 322,
+ 323
+ ],
+ "value": 5,
+ "raw": "5"
+ }
+ }
+ }
+ ],
+ "sourceType": "script",
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ }
+ },
+ "range": [
+ 73,
+ 74
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "using",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "range": [
+ 75,
+ 80
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "[",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "range": [
+ 81,
+ 82
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "a",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "range": [
+ 82,
+ 83
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ",",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "range": [
+ 83,
+ 84
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "b",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "range": [
+ 85,
+ 86
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "]",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "range": [
+ 86,
+ 87
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "=",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "range": [
+ 88,
+ 89
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "arr",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "range": [
+ 90,
+ 93
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ";",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "range": [
+ 93,
+ 94
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "range": [
+ 95,
+ 96
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ },
+ "range": [
+ 125,
+ 126
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "using",
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 7
+ }
+ },
+ "range": [
+ 127,
+ 132
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "x",
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 5
+ }
+ },
+ "range": [
+ 137,
+ 138
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "=",
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 6
+ },
+ "end": {
+ "line": 4,
+ "column": 7
+ }
+ },
+ "range": [
+ 139,
+ 140
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "foo",
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 11
+ }
+ },
+ "range": [
+ 141,
+ 144
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 11
+ },
+ "end": {
+ "line": 4,
+ "column": 12
+ }
+ },
+ "range": [
+ 144,
+ 145
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 12
+ },
+ "end": {
+ "line": 4,
+ "column": 13
+ }
+ },
+ "range": [
+ 145,
+ 146
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ";",
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 13
+ },
+ "end": {
+ "line": 4,
+ "column": 14
+ }
+ },
+ "range": [
+ 146,
+ 147
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 15
+ },
+ "end": {
+ "line": 4,
+ "column": 16
+ }
+ },
+ "range": [
+ 148,
+ 149
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "async",
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 5
+ }
+ },
+ "range": [
+ 175,
+ 180
+ ]
+ },
+ {
+ "type": "Keyword",
+ "value": "function",
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 6
+ },
+ "end": {
+ "line": 5,
+ "column": 14
+ }
+ },
+ "range": [
+ 181,
+ 189
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "fn",
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 15
+ },
+ "end": {
+ "line": 5,
+ "column": 17
+ }
+ },
+ "range": [
+ 190,
+ 192
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 17
+ },
+ "end": {
+ "line": 5,
+ "column": 18
+ }
+ },
+ "range": [
+ 192,
+ 193
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 18
+ },
+ "end": {
+ "line": 5,
+ "column": 19
+ }
+ },
+ "range": [
+ 193,
+ 194
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 20
+ },
+ "end": {
+ "line": 5,
+ "column": 21
+ }
+ },
+ "range": [
+ 195,
+ 196
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 4
+ },
+ "end": {
+ "line": 6,
+ "column": 5
+ }
+ },
+ "range": [
+ 201,
+ 202
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "await",
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 6
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ },
+ "range": [
+ 203,
+ 208
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "using",
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 12
+ },
+ "end": {
+ "line": 6,
+ "column": 17
+ }
+ },
+ "range": [
+ 209,
+ 214
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "x",
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 8
+ },
+ "end": {
+ "line": 7,
+ "column": 9
+ }
+ },
+ "range": [
+ 223,
+ 224
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "=",
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 10
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ },
+ "range": [
+ 225,
+ 226
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "foo",
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 12
+ },
+ "end": {
+ "line": 7,
+ "column": 15
+ }
+ },
+ "range": [
+ 227,
+ 230
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 15
+ },
+ "end": {
+ "line": 7,
+ "column": 16
+ }
+ },
+ "range": [
+ 230,
+ 231
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 16
+ },
+ "end": {
+ "line": 7,
+ "column": 17
+ }
+ },
+ "range": [
+ 231,
+ 232
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ";",
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 17
+ },
+ "end": {
+ "line": 7,
+ "column": 18
+ }
+ },
+ "range": [
+ 232,
+ 233
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 19
+ },
+ "end": {
+ "line": 7,
+ "column": 20
+ }
+ },
+ "range": [
+ 234,
+ 235
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 1
+ }
+ },
+ "range": [
+ 263,
+ 264
+ ]
+ },
+ {
+ "type": "Keyword",
+ "value": "for",
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 3
+ }
+ },
+ "range": [
+ 290,
+ 293
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 4
+ },
+ "end": {
+ "line": 11,
+ "column": 5
+ }
+ },
+ "range": [
+ 294,
+ 295
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "using",
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 5
+ },
+ "end": {
+ "line": 11,
+ "column": 10
+ }
+ },
+ "range": [
+ 295,
+ 300
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "of",
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 11
+ },
+ "end": {
+ "line": 11,
+ "column": 13
+ }
+ },
+ "range": [
+ 301,
+ 303
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "foo",
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 14
+ },
+ "end": {
+ "line": 11,
+ "column": 17
+ }
+ },
+ "range": [
+ 304,
+ 307
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 17
+ },
+ "end": {
+ "line": 11,
+ "column": 18
+ }
+ },
+ "range": [
+ 307,
+ 308
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 18
+ },
+ "end": {
+ "line": 11,
+ "column": 19
+ }
+ },
+ "range": [
+ 308,
+ 309
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 19
+ },
+ "end": {
+ "line": 11,
+ "column": 20
+ }
+ },
+ "range": [
+ 309,
+ 310
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 21
+ },
+ "end": {
+ "line": 11,
+ "column": 22
+ }
+ },
+ "range": [
+ 311,
+ 312
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 22
+ },
+ "end": {
+ "line": 11,
+ "column": 23
+ }
+ },
+ "range": [
+ 312,
+ 313
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "using",
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 0
+ },
+ "end": {
+ "line": 12,
+ "column": 5
+ }
+ },
+ "range": [
+ 314,
+ 319
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "=",
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 6
+ },
+ "end": {
+ "line": 12,
+ "column": 7
+ }
+ },
+ "range": [
+ 320,
+ 321
+ ]
+ },
+ {
+ "type": "Numeric",
+ "value": "5",
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 8
+ },
+ "end": {
+ "line": 12,
+ "column": 9
+ }
+ },
+ "range": [
+ 322,
+ 323
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ";",
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 9
+ },
+ "end": {
+ "line": 12,
+ "column": 10
+ }
+ },
+ "range": [
+ 323,
+ 324
+ ]
+ }
+ ]
+};
\ No newline at end of file
diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-not-using.src.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-not-using.src.js
new file mode 100644
index 00000000..51d65ca3
--- /dev/null
+++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-not-using.src.js
@@ -0,0 +1,12 @@
+// For compatibility, syntax that looks like `using` but is not `using`.
+{ using [a, b] = arr; } // { using[(a, b)] = arr; }
+{ using
+ x = foo(); } // { using; x = foo(); }
+async function fn() {
+ { await using
+ x = foo(); } // await using; x = foo();
+}
+
+// `using` identifiers.
+for (using of foo()) {}
+using = 5;
diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-await-using.module-result.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-await-using.module-result.js
new file mode 100644
index 00000000..e1a0d273
--- /dev/null
+++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-await-using.module-result.js
@@ -0,0 +1,258 @@
+export default {
+ "type": "Program",
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "range": [
+ 0,
+ 22
+ ],
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "range": [
+ 0,
+ 22
+ ],
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "range": [
+ 12,
+ 21
+ ],
+ "id": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "range": [
+ 12,
+ 13
+ ],
+ "name": "y"
+ },
+ "init": {
+ "type": "CallExpression",
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "range": [
+ 16,
+ 21
+ ],
+ "callee": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "range": [
+ 16,
+ 19
+ ],
+ "name": "bar"
+ },
+ "arguments": [],
+ "optional": false
+ }
+ }
+ ],
+ "kind": "await using"
+ }
+ ],
+ "sourceType": "module",
+ "tokens": [
+ {
+ "type": "Identifier",
+ "value": "await",
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "range": [
+ 0,
+ 5
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "using",
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "range": [
+ 6,
+ 11
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "y",
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "range": [
+ 12,
+ 13
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "=",
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "range": [
+ 14,
+ 15
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "bar",
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "range": [
+ 16,
+ 19
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ },
+ "range": [
+ 19,
+ 20
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "range": [
+ 20,
+ 21
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ";",
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "range": [
+ 21,
+ 22
+ ]
+ }
+ ]
+};
\ No newline at end of file
diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-await-using.result.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-await-using.result.js
new file mode 100644
index 00000000..6d5080ee
--- /dev/null
+++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-await-using.result.js
@@ -0,0 +1,6 @@
+export default {
+ "index": 0,
+ "lineNumber": 1,
+ "column": 1,
+ "message": "Using declaration cannot appear in the top level when source type is `script`"
+};
\ No newline at end of file
diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-await-using.src.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-await-using.src.js
new file mode 100644
index 00000000..8256f5b0
--- /dev/null
+++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-await-using.src.js
@@ -0,0 +1 @@
+await using y = bar();
diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-using.module-result.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-using.module-result.js
new file mode 100644
index 00000000..eaa34a66
--- /dev/null
+++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-using.module-result.js
@@ -0,0 +1,240 @@
+export default {
+ "type": "Program",
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "range": [
+ 0,
+ 16
+ ],
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "range": [
+ 0,
+ 16
+ ],
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "range": [
+ 6,
+ 15
+ ],
+ "id": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "range": [
+ 6,
+ 7
+ ],
+ "name": "x"
+ },
+ "init": {
+ "type": "CallExpression",
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "range": [
+ 10,
+ 15
+ ],
+ "callee": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "range": [
+ 10,
+ 13
+ ],
+ "name": "foo"
+ },
+ "arguments": [],
+ "optional": false
+ }
+ }
+ ],
+ "kind": "using"
+ }
+ ],
+ "sourceType": "module",
+ "tokens": [
+ {
+ "type": "Identifier",
+ "value": "using",
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "range": [
+ 0,
+ 5
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "x",
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "range": [
+ 6,
+ 7
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "=",
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "range": [
+ 8,
+ 9
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "foo",
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "range": [
+ 10,
+ 13
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "range": [
+ 13,
+ 14
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "range": [
+ 14,
+ 15
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ";",
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "range": [
+ 15,
+ 16
+ ]
+ }
+ ]
+};
\ No newline at end of file
diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-using.result.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-using.result.js
new file mode 100644
index 00000000..6d5080ee
--- /dev/null
+++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-using.result.js
@@ -0,0 +1,6 @@
+export default {
+ "index": 0,
+ "lineNumber": 1,
+ "column": 1,
+ "message": "Using declaration cannot appear in the top level when source type is `script`"
+};
\ No newline at end of file
diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-using.src.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-using.src.js
new file mode 100644
index 00000000..503dc7e6
--- /dev/null
+++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-using.src.js
@@ -0,0 +1 @@
+using x = foo();
diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-using.result.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-using.result.js
new file mode 100644
index 00000000..b7b172e3
--- /dev/null
+++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-using.result.js
@@ -0,0 +1,2201 @@
+export default {
+ "type": "Program",
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 1
+ }
+ },
+ "range": [
+ 0,
+ 207
+ ],
+ "body": [
+ {
+ "type": "BlockStatement",
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "range": [
+ 0,
+ 56
+ ],
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "range": [
+ 6,
+ 22
+ ],
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "range": [
+ 12,
+ 21
+ ],
+ "id": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "range": [
+ 12,
+ 13
+ ],
+ "name": "x"
+ },
+ "init": {
+ "type": "CallExpression",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "range": [
+ 16,
+ 21
+ ],
+ "callee": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "range": [
+ 16,
+ 19
+ ],
+ "name": "foo"
+ },
+ "arguments": [],
+ "optional": false
+ }
+ }
+ ],
+ "kind": "using"
+ },
+ {
+ "type": "VariableDeclaration",
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 31
+ }
+ },
+ "range": [
+ 27,
+ 54
+ ],
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 19
+ }
+ },
+ "range": [
+ 33,
+ 42
+ ],
+ "id": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "range": [
+ 33,
+ 34
+ ],
+ "name": "a"
+ },
+ "init": {
+ "type": "CallExpression",
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 14
+ },
+ "end": {
+ "line": 3,
+ "column": 19
+ }
+ },
+ "range": [
+ 37,
+ 42
+ ],
+ "callee": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 14
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ },
+ "range": [
+ 37,
+ 40
+ ],
+ "name": "foo"
+ },
+ "arguments": [],
+ "optional": false
+ }
+ },
+ {
+ "type": "VariableDeclarator",
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 21
+ },
+ "end": {
+ "line": 3,
+ "column": 30
+ }
+ },
+ "range": [
+ 44,
+ 53
+ ],
+ "id": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 21
+ },
+ "end": {
+ "line": 3,
+ "column": 22
+ }
+ },
+ "range": [
+ 44,
+ 45
+ ],
+ "name": "b"
+ },
+ "init": {
+ "type": "CallExpression",
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 25
+ },
+ "end": {
+ "line": 3,
+ "column": 30
+ }
+ },
+ "range": [
+ 48,
+ 53
+ ],
+ "callee": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 25
+ },
+ "end": {
+ "line": 3,
+ "column": 28
+ }
+ },
+ "range": [
+ 48,
+ 51
+ ],
+ "name": "bar"
+ },
+ "arguments": [],
+ "optional": false
+ }
+ }
+ ],
+ "kind": "using"
+ }
+ ]
+ },
+ {
+ "type": "ForOfStatement",
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 25
+ }
+ },
+ "range": [
+ 57,
+ 82
+ ],
+ "await": false,
+ "left": {
+ "type": "VariableDeclaration",
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 5
+ },
+ "end": {
+ "line": 5,
+ "column": 12
+ }
+ },
+ "range": [
+ 62,
+ 69
+ ],
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 11
+ },
+ "end": {
+ "line": 5,
+ "column": 12
+ }
+ },
+ "range": [
+ 68,
+ 69
+ ],
+ "id": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 11
+ },
+ "end": {
+ "line": 5,
+ "column": 12
+ }
+ },
+ "range": [
+ 68,
+ 69
+ ],
+ "name": "x"
+ },
+ "init": null
+ }
+ ],
+ "kind": "using"
+ },
+ "right": {
+ "type": "CallExpression",
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 16
+ },
+ "end": {
+ "line": 5,
+ "column": 21
+ }
+ },
+ "range": [
+ 73,
+ 78
+ ],
+ "callee": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 16
+ },
+ "end": {
+ "line": 5,
+ "column": 19
+ }
+ },
+ "range": [
+ 73,
+ 76
+ ],
+ "name": "foo"
+ },
+ "arguments": [],
+ "optional": false
+ },
+ "body": {
+ "type": "BlockStatement",
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 23
+ },
+ "end": {
+ "line": 5,
+ "column": 25
+ }
+ },
+ "range": [
+ 80,
+ 82
+ ],
+ "body": []
+ }
+ },
+ {
+ "type": "FunctionDeclaration",
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 1
+ }
+ },
+ "range": [
+ 83,
+ 207
+ ],
+ "id": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 15
+ },
+ "end": {
+ "line": 6,
+ "column": 17
+ }
+ },
+ "range": [
+ 98,
+ 100
+ ],
+ "name": "fn"
+ },
+ "expression": false,
+ "generator": false,
+ "async": true,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 20
+ },
+ "end": {
+ "line": 10,
+ "column": 1
+ }
+ },
+ "range": [
+ 103,
+ 207
+ ],
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 4
+ },
+ "end": {
+ "line": 7,
+ "column": 26
+ }
+ },
+ "range": [
+ 109,
+ 131
+ ],
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 16
+ },
+ "end": {
+ "line": 7,
+ "column": 25
+ }
+ },
+ "range": [
+ 121,
+ 130
+ ],
+ "id": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 16
+ },
+ "end": {
+ "line": 7,
+ "column": 17
+ }
+ },
+ "range": [
+ 121,
+ 122
+ ],
+ "name": "x"
+ },
+ "init": {
+ "type": "CallExpression",
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 20
+ },
+ "end": {
+ "line": 7,
+ "column": 25
+ }
+ },
+ "range": [
+ 125,
+ 130
+ ],
+ "callee": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 20
+ },
+ "end": {
+ "line": 7,
+ "column": 23
+ }
+ },
+ "range": [
+ 125,
+ 128
+ ],
+ "name": "foo"
+ },
+ "arguments": [],
+ "optional": false
+ }
+ }
+ ],
+ "kind": "await using"
+ },
+ {
+ "type": "VariableDeclaration",
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 4
+ },
+ "end": {
+ "line": 8,
+ "column": 37
+ }
+ },
+ "range": [
+ 136,
+ 169
+ ],
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 16
+ },
+ "end": {
+ "line": 8,
+ "column": 25
+ }
+ },
+ "range": [
+ 148,
+ 157
+ ],
+ "id": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 16
+ },
+ "end": {
+ "line": 8,
+ "column": 17
+ }
+ },
+ "range": [
+ 148,
+ 149
+ ],
+ "name": "a"
+ },
+ "init": {
+ "type": "CallExpression",
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 20
+ },
+ "end": {
+ "line": 8,
+ "column": 25
+ }
+ },
+ "range": [
+ 152,
+ 157
+ ],
+ "callee": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 20
+ },
+ "end": {
+ "line": 8,
+ "column": 23
+ }
+ },
+ "range": [
+ 152,
+ 155
+ ],
+ "name": "foo"
+ },
+ "arguments": [],
+ "optional": false
+ }
+ },
+ {
+ "type": "VariableDeclarator",
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 27
+ },
+ "end": {
+ "line": 8,
+ "column": 36
+ }
+ },
+ "range": [
+ 159,
+ 168
+ ],
+ "id": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 27
+ },
+ "end": {
+ "line": 8,
+ "column": 28
+ }
+ },
+ "range": [
+ 159,
+ 160
+ ],
+ "name": "b"
+ },
+ "init": {
+ "type": "CallExpression",
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 31
+ },
+ "end": {
+ "line": 8,
+ "column": 36
+ }
+ },
+ "range": [
+ 163,
+ 168
+ ],
+ "callee": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 31
+ },
+ "end": {
+ "line": 8,
+ "column": 34
+ }
+ },
+ "range": [
+ 163,
+ 166
+ ],
+ "name": "bar"
+ },
+ "arguments": [],
+ "optional": false
+ }
+ }
+ ],
+ "kind": "await using"
+ },
+ {
+ "type": "ForOfStatement",
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 4
+ },
+ "end": {
+ "line": 9,
+ "column": 35
+ }
+ },
+ "range": [
+ 174,
+ 205
+ ],
+ "await": false,
+ "left": {
+ "type": "VariableDeclaration",
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 22
+ }
+ },
+ "range": [
+ 179,
+ 192
+ ],
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 21
+ },
+ "end": {
+ "line": 9,
+ "column": 22
+ }
+ },
+ "range": [
+ 191,
+ 192
+ ],
+ "id": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 21
+ },
+ "end": {
+ "line": 9,
+ "column": 22
+ }
+ },
+ "range": [
+ 191,
+ 192
+ ],
+ "name": "x"
+ },
+ "init": null
+ }
+ ],
+ "kind": "await using"
+ },
+ "right": {
+ "type": "CallExpression",
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 26
+ },
+ "end": {
+ "line": 9,
+ "column": 31
+ }
+ },
+ "range": [
+ 196,
+ 201
+ ],
+ "callee": {
+ "type": "Identifier",
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 26
+ },
+ "end": {
+ "line": 9,
+ "column": 29
+ }
+ },
+ "range": [
+ 196,
+ 199
+ ],
+ "name": "foo"
+ },
+ "arguments": [],
+ "optional": false
+ },
+ "body": {
+ "type": "BlockStatement",
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 33
+ },
+ "end": {
+ "line": 9,
+ "column": 35
+ }
+ },
+ "range": [
+ 203,
+ 205
+ ],
+ "body": []
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "sourceType": "script",
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ }
+ },
+ "range": [
+ 0,
+ 1
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "using",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "range": [
+ 6,
+ 11
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "x",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "range": [
+ 12,
+ 13
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "=",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "range": [
+ 14,
+ 15
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "foo",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "range": [
+ 16,
+ 19
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "range": [
+ 19,
+ 20
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "range": [
+ 20,
+ 21
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ";",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "range": [
+ 21,
+ 22
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "using",
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "range": [
+ 27,
+ 32
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "a",
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "range": [
+ 33,
+ 34
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "=",
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 12
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ },
+ "range": [
+ 35,
+ 36
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "foo",
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 14
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ },
+ "range": [
+ 37,
+ 40
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 18
+ }
+ },
+ "range": [
+ 40,
+ 41
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 18
+ },
+ "end": {
+ "line": 3,
+ "column": 19
+ }
+ },
+ "range": [
+ 41,
+ 42
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ",",
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 19
+ },
+ "end": {
+ "line": 3,
+ "column": 20
+ }
+ },
+ "range": [
+ 42,
+ 43
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "b",
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 21
+ },
+ "end": {
+ "line": 3,
+ "column": 22
+ }
+ },
+ "range": [
+ 44,
+ 45
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "=",
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 23
+ },
+ "end": {
+ "line": 3,
+ "column": 24
+ }
+ },
+ "range": [
+ 46,
+ 47
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "bar",
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 25
+ },
+ "end": {
+ "line": 3,
+ "column": 28
+ }
+ },
+ "range": [
+ 48,
+ 51
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 28
+ },
+ "end": {
+ "line": 3,
+ "column": 29
+ }
+ },
+ "range": [
+ 51,
+ 52
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 29
+ },
+ "end": {
+ "line": 3,
+ "column": 30
+ }
+ },
+ "range": [
+ 52,
+ 53
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ";",
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 30
+ },
+ "end": {
+ "line": 3,
+ "column": 31
+ }
+ },
+ "range": [
+ 53,
+ 54
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "range": [
+ 55,
+ 56
+ ]
+ },
+ {
+ "type": "Keyword",
+ "value": "for",
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 3
+ }
+ },
+ "range": [
+ 57,
+ 60
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 4
+ },
+ "end": {
+ "line": 5,
+ "column": 5
+ }
+ },
+ "range": [
+ 61,
+ 62
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "using",
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 5
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "range": [
+ 62,
+ 67
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "x",
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 11
+ },
+ "end": {
+ "line": 5,
+ "column": 12
+ }
+ },
+ "range": [
+ 68,
+ 69
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "of",
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 13
+ },
+ "end": {
+ "line": 5,
+ "column": 15
+ }
+ },
+ "range": [
+ 70,
+ 72
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "foo",
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 16
+ },
+ "end": {
+ "line": 5,
+ "column": 19
+ }
+ },
+ "range": [
+ 73,
+ 76
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 19
+ },
+ "end": {
+ "line": 5,
+ "column": 20
+ }
+ },
+ "range": [
+ 76,
+ 77
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 20
+ },
+ "end": {
+ "line": 5,
+ "column": 21
+ }
+ },
+ "range": [
+ 77,
+ 78
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 21
+ },
+ "end": {
+ "line": 5,
+ "column": 22
+ }
+ },
+ "range": [
+ 78,
+ 79
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 23
+ },
+ "end": {
+ "line": 5,
+ "column": 24
+ }
+ },
+ "range": [
+ 80,
+ 81
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 24
+ },
+ "end": {
+ "line": 5,
+ "column": 25
+ }
+ },
+ "range": [
+ 81,
+ 82
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "async",
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 5
+ }
+ },
+ "range": [
+ 83,
+ 88
+ ]
+ },
+ {
+ "type": "Keyword",
+ "value": "function",
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 6
+ },
+ "end": {
+ "line": 6,
+ "column": 14
+ }
+ },
+ "range": [
+ 89,
+ 97
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "fn",
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 15
+ },
+ "end": {
+ "line": 6,
+ "column": 17
+ }
+ },
+ "range": [
+ 98,
+ 100
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 17
+ },
+ "end": {
+ "line": 6,
+ "column": 18
+ }
+ },
+ "range": [
+ 100,
+ 101
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 18
+ },
+ "end": {
+ "line": 6,
+ "column": 19
+ }
+ },
+ "range": [
+ 101,
+ 102
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 20
+ },
+ "end": {
+ "line": 6,
+ "column": 21
+ }
+ },
+ "range": [
+ 103,
+ 104
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "await",
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 4
+ },
+ "end": {
+ "line": 7,
+ "column": 9
+ }
+ },
+ "range": [
+ 109,
+ 114
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "using",
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 10
+ },
+ "end": {
+ "line": 7,
+ "column": 15
+ }
+ },
+ "range": [
+ 115,
+ 120
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "x",
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 16
+ },
+ "end": {
+ "line": 7,
+ "column": 17
+ }
+ },
+ "range": [
+ 121,
+ 122
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "=",
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 18
+ },
+ "end": {
+ "line": 7,
+ "column": 19
+ }
+ },
+ "range": [
+ 123,
+ 124
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "foo",
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 20
+ },
+ "end": {
+ "line": 7,
+ "column": 23
+ }
+ },
+ "range": [
+ 125,
+ 128
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 23
+ },
+ "end": {
+ "line": 7,
+ "column": 24
+ }
+ },
+ "range": [
+ 128,
+ 129
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 24
+ },
+ "end": {
+ "line": 7,
+ "column": 25
+ }
+ },
+ "range": [
+ 129,
+ 130
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ";",
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 25
+ },
+ "end": {
+ "line": 7,
+ "column": 26
+ }
+ },
+ "range": [
+ 130,
+ 131
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "await",
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 4
+ },
+ "end": {
+ "line": 8,
+ "column": 9
+ }
+ },
+ "range": [
+ 136,
+ 141
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "using",
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 10
+ },
+ "end": {
+ "line": 8,
+ "column": 15
+ }
+ },
+ "range": [
+ 142,
+ 147
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "a",
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 16
+ },
+ "end": {
+ "line": 8,
+ "column": 17
+ }
+ },
+ "range": [
+ 148,
+ 149
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "=",
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 18
+ },
+ "end": {
+ "line": 8,
+ "column": 19
+ }
+ },
+ "range": [
+ 150,
+ 151
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "foo",
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 20
+ },
+ "end": {
+ "line": 8,
+ "column": 23
+ }
+ },
+ "range": [
+ 152,
+ 155
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 23
+ },
+ "end": {
+ "line": 8,
+ "column": 24
+ }
+ },
+ "range": [
+ 155,
+ 156
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 24
+ },
+ "end": {
+ "line": 8,
+ "column": 25
+ }
+ },
+ "range": [
+ 156,
+ 157
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ",",
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 25
+ },
+ "end": {
+ "line": 8,
+ "column": 26
+ }
+ },
+ "range": [
+ 157,
+ 158
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "b",
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 27
+ },
+ "end": {
+ "line": 8,
+ "column": 28
+ }
+ },
+ "range": [
+ 159,
+ 160
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "=",
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 29
+ },
+ "end": {
+ "line": 8,
+ "column": 30
+ }
+ },
+ "range": [
+ 161,
+ 162
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "bar",
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 31
+ },
+ "end": {
+ "line": 8,
+ "column": 34
+ }
+ },
+ "range": [
+ 163,
+ 166
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 34
+ },
+ "end": {
+ "line": 8,
+ "column": 35
+ }
+ },
+ "range": [
+ 166,
+ 167
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 35
+ },
+ "end": {
+ "line": 8,
+ "column": 36
+ }
+ },
+ "range": [
+ 167,
+ 168
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ";",
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 36
+ },
+ "end": {
+ "line": 8,
+ "column": 37
+ }
+ },
+ "range": [
+ 168,
+ 169
+ ]
+ },
+ {
+ "type": "Keyword",
+ "value": "for",
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 4
+ },
+ "end": {
+ "line": 9,
+ "column": 7
+ }
+ },
+ "range": [
+ 174,
+ 177
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 8
+ },
+ "end": {
+ "line": 9,
+ "column": 9
+ }
+ },
+ "range": [
+ 178,
+ 179
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "await",
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 14
+ }
+ },
+ "range": [
+ 179,
+ 184
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "using",
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 15
+ },
+ "end": {
+ "line": 9,
+ "column": 20
+ }
+ },
+ "range": [
+ 185,
+ 190
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "x",
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 21
+ },
+ "end": {
+ "line": 9,
+ "column": 22
+ }
+ },
+ "range": [
+ 191,
+ 192
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "of",
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 23
+ },
+ "end": {
+ "line": 9,
+ "column": 25
+ }
+ },
+ "range": [
+ 193,
+ 195
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "foo",
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 26
+ },
+ "end": {
+ "line": 9,
+ "column": 29
+ }
+ },
+ "range": [
+ 196,
+ 199
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 29
+ },
+ "end": {
+ "line": 9,
+ "column": 30
+ }
+ },
+ "range": [
+ 199,
+ 200
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 30
+ },
+ "end": {
+ "line": 9,
+ "column": 31
+ }
+ },
+ "range": [
+ 200,
+ 201
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 31
+ },
+ "end": {
+ "line": 9,
+ "column": 32
+ }
+ },
+ "range": [
+ 201,
+ 202
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 33
+ },
+ "end": {
+ "line": 9,
+ "column": 34
+ }
+ },
+ "range": [
+ 203,
+ 204
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 34
+ },
+ "end": {
+ "line": 9,
+ "column": 35
+ }
+ },
+ "range": [
+ 204,
+ 205
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 1
+ }
+ },
+ "range": [
+ 206,
+ 207
+ ]
+ }
+ ]
+};
\ No newline at end of file
diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-using.src.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-using.src.js
new file mode 100644
index 00000000..0cf5b108
--- /dev/null
+++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-using.src.js
@@ -0,0 +1,10 @@
+{
+ using x = foo();
+ using a = foo(), b = bar();
+}
+for (using x of foo()) {}
+async function fn() {
+ await using x = foo();
+ await using a = foo(), b = bar();
+ for (await using x of foo()) {}
+}
diff --git a/packages/espree/tests/lib/supported-ecmaversions.js b/packages/espree/tests/lib/supported-ecmaversions.js
index 107eb993..75e3f6c6 100644
--- a/packages/espree/tests/lib/supported-ecmaversions.js
+++ b/packages/espree/tests/lib/supported-ecmaversions.js
@@ -17,7 +17,7 @@ import * as espree from "../../espree.js";
describe("latestEcmaVersion", () => {
it("should return the latest supported ecmaVersion", () => {
- assert.strictEqual(espree.latestEcmaVersion, 16);
+ assert.strictEqual(espree.latestEcmaVersion, 17);
});
});
@@ -25,7 +25,7 @@ describe("supportedEcmaVersions", () => {
it("should return an array of all supported versions", () => {
assert.deepStrictEqual(
espree.supportedEcmaVersions,
- [3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
+ [3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
);
});
});
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy