Skip to content

Commit

Permalink
Update: Support top-level await and regexp match indices (#505)
Browse files Browse the repository at this point in the history
* Update: Support top-level await and regexp match indices

* Fix failing test

* Fix test

* Clean up regex test

* Update readme

* Update tests/fixtures/ecma-version/13/regexp-match-indices/regexp-match-indices.result.js

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

* Update tests/fixtures/ecma-version/13/regexp-match-indices/regexp-match-indices.result.js

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

* Ensure top-level await test only runs in modules

* Cleanup file structure

* Update Acorn

Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
  • Loading branch information
nzakas and mdjermanovic authored Jun 24, 2021
1 parent 9eff2c7 commit e207bd7
Show file tree
Hide file tree
Showing 7 changed files with 429 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ Because ECMAScript 2022 is still under development, we are implementing features
* [Class instance fields](https://github.com/tc39/proposal-class-fields)
* [Class private instance methods and accessors](https://github.com/tc39/proposal-private-methods)
* [Class static fields, static private methods and accessors](https://github.com/tc39/proposal-static-class-features)
* [RegExp match indices](https://github.com/tc39/proposal-regexp-match-indices)
* [Top-level await](https://github.com/tc39/proposal-top-level-await)

See [finished-proposals.md](https://github.com/tc39/proposals/blob/master/finished-proposals.md) to know what features are finalized.

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"license": "BSD-2-Clause",
"dependencies": {
"acorn": "^8.2.2",
"acorn": "^8.4.1",
"acorn-jsx": "^5.3.1",
"eslint-visitor-keys": "^2.1.0"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
export default {
"type": "Program",
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 12
}
},
"range": [
0,
12
],
"body": [
{
"type": "ExpressionStatement",
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 12
}
},
"range": [
0,
12
],
"expression": {
"type": "AwaitExpression",
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 11
}
},
"range": [
0,
11
],
"argument": {
"type": "CallExpression",
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 11
}
},
"range": [
6,
11
],
"callee": {
"type": "Identifier",
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 9
}
},
"range": [
6,
9
],
"name": "foo"
},
"arguments": [],
"optional": false
}
}
}
],
"sourceType": "script",
"tokens": [
{
"type": "Identifier",
"value": "await",
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 5
}
},
"range": [
0,
5
]
},
{
"type": "Identifier",
"value": "foo",
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 9
}
},
"range": [
6,
9
]
},
{
"type": "Punctuator",
"value": "(",
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 10
}
},
"range": [
9,
10
]
},
{
"type": "Punctuator",
"value": ")",
"loc": {
"start": {
"line": 1,
"column": 10
},
"end": {
"line": 1,
"column": 11
}
},
"range": [
10,
11
]
},
{
"type": "Punctuator",
"value": ";",
"loc": {
"start": {
"line": 1,
"column": 11
},
"end": {
"line": 1,
"column": 12
}
},
"range": [
11,
12
]
}
]
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
await foo();
Loading

0 comments on commit e207bd7

Please sign in to comment.