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
2 changes: 2 additions & 0 deletions README.md
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
Expand Up @@ -31,7 +31,7 @@
},
"license": "BSD-2-Clause",
"dependencies": {
"acorn": "^8.2.2",
"acorn": "^8.4.0",
"acorn-jsx": "^5.3.1",
"eslint-visitor-keys": "^2.1.0"
},
Expand Down
@@ -0,0 +1,198 @@
import conditionalRegex from "../../../../lib/conditional-regex-value.js";

export default {
"type": "Program",
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 25
}
},
"range": [
0,
25
],
"body": [
{
"type": "VariableDeclaration",
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 25
}
},
"range": [
0,
25
],
"declarations": [
{
"type": "VariableDeclarator",
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 24
}
},
"range": [
6,
24
],
"id": {
"type": "Identifier",
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 9
}
},
"range": [
6,
9
],
"name": "re1"
},
"init": conditionalRegex({
"type": "Literal",
"loc": {
"start": {
"line": 1,
"column": 12
},
"end": {
"line": 1,
"column": 24
}
},
"range": [
12,
24
],

// /d flag no supported in Node.js 12 or 14 yet
"value": null,
"raw": "/a+(<Z>z)?/d",
"regex": {
"pattern": "a+(<Z>z)?",
"flags": "d"
}
})
}
],
"kind": "const"
}
],
"sourceType": "script",
"tokens": [
{
"type": "Keyword",
"value": "const",
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 5
}
},
"range": [
0,
5
]
},
{
"type": "Identifier",
"value": "re1",
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 9
}
},
"range": [
6,
9
]
},
{
"type": "Punctuator",
"value": "=",
"loc": {
"start": {
"line": 1,
"column": 10
},
"end": {
"line": 1,
"column": 11
}
},
"range": [
10,
11
]
},
{
"type": "RegularExpression",
"value": "/a+(<Z>z)?/d",
"loc": {
"start": {
"line": 1,
"column": 12
},
"end": {
"line": 1,
"column": 24
}
},
"range": [
12,
24
],
"regex": {
"flags": "d",
"pattern": "a+(<Z>z)?"
}
},
{
"type": "Punctuator",
"value": ";",
"loc": {
"start": {
"line": 1,
"column": 24
},
"end": {
"line": 1,
"column": 25
}
},
"range": [
24,
25
]
}
]
};
@@ -0,0 +1 @@
const re1 = /a+(<Z>z)?/d;