Skip to content

Commit

Permalink
Update: support ?? operator, import.meta, and export * as ns (#441
Browse files Browse the repository at this point in the history
)

* fix existing tests
* add tests for new syntax
* update acorn
* update eslint-visitor-keys
  • Loading branch information
mysticatea committed Jun 4, 2020
1 parent ad0543c commit 75e80bc
Show file tree
Hide file tree
Showing 31 changed files with 2,111 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -18,9 +18,9 @@
},
"license": "BSD-2-Clause",
"dependencies": {
"acorn": "^7.1.1",
"acorn": "^7.2.0",
"acorn-jsx": "^5.2.0",
"eslint-visitor-keys": "^1.1.0"
"eslint-visitor-keys": "^1.2.0"
},
"devDependencies": {
"browserify": "^16.5.0",
Expand Down
@@ -1,6 +1,6 @@
module.exports = {
"index": 16,
"index": 17,
"lineNumber": 1,
"column": 17,
"message": "Unexpected token ."
"column": 18,
"message": "The only valid meta property for import is 'import.meta'"
};
Expand Up @@ -3,4 +3,4 @@ module.exports = {
"lineNumber": 1,
"column": 5,
"message": "Cannot use new with import()"
};
};
@@ -0,0 +1,184 @@
module.exports = {
"type": "Program",
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 28
}
},
"range": [
0,
28
],
"body": [
{
"type": "ExportAllDeclaration",
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 28
}
},
"range": [
0,
28
],
"exported": {
"type": "Identifier",
"loc": {
"start": {
"line": 1,
"column": 12
},
"end": {
"line": 1,
"column": 14
}
},
"range": [
12,
14
],
"name": "ns"
},
"source": {
"type": "Literal",
"loc": {
"start": {
"line": 1,
"column": 20
},
"end": {
"line": 1,
"column": 28
}
},
"range": [
20,
28
],
"value": "source",
"raw": "\"source\""
}
}
],
"sourceType": "module",
"tokens": [
{
"type": "Keyword",
"value": "export",
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 6
}
},
"range": [
0,
6
]
},
{
"type": "Punctuator",
"value": "*",
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 8
}
},
"range": [
7,
8
]
},
{
"type": "Identifier",
"value": "as",
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 11
}
},
"range": [
9,
11
]
},
{
"type": "Identifier",
"value": "ns",
"loc": {
"start": {
"line": 1,
"column": 12
},
"end": {
"line": 1,
"column": 14
}
},
"range": [
12,
14
]
},
{
"type": "Identifier",
"value": "from",
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 19
}
},
"range": [
15,
19
]
},
{
"type": "String",
"value": "\"source\"",
"loc": {
"start": {
"line": 1,
"column": 20
},
"end": {
"line": 1,
"column": 28
}
},
"range": [
20,
28
]
}
]
};
@@ -0,0 +1 @@
export * as ns from "source"
@@ -0,0 +1,131 @@
module.exports = {
"type": "Program",
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 22
}
},
"range": [
0,
22
],
"body": [
{
"type": "ExportAllDeclaration",
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 22
}
},
"range": [
0,
22
],
"exported": null,
"source": {
"type": "Literal",
"loc": {
"start": {
"line": 1,
"column": 14
},
"end": {
"line": 1,
"column": 22
}
},
"range": [
14,
22
],
"value": "source",
"raw": "\"source\""
}
}
],
"sourceType": "module",
"tokens": [
{
"type": "Keyword",
"value": "export",
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 6
}
},
"range": [
0,
6
]
},
{
"type": "Punctuator",
"value": "*",
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 8
}
},
"range": [
7,
8
]
},
{
"type": "Identifier",
"value": "from",
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 13
}
},
"range": [
9,
13
]
},
{
"type": "String",
"value": "\"source\"",
"loc": {
"start": {
"line": 1,
"column": 14
},
"end": {
"line": 1,
"column": 22
}
},
"range": [
14,
22
]
}
]
};
@@ -0,0 +1 @@
export * from "source"

0 comments on commit 75e80bc

Please sign in to comment.