Skip to content

Commit f5e58cc

Browse files
mysticateaplatinumazure
authored andcommitted
Update: support bigint and dynamic import (#415)
* fix a failing test with acorn 6.2.0 * update acorn * fix CI failure * update eslint-visitor-keys * Upgrade: acorn@^7.0.0, eslint-visitor-keys@^1.1.0 * Chore: Fix invalid-new-import fixture index/column Looks like the fixture previously assumed the `expression` node would be where the error is located, but it looks like the error is located at the `import` token instead.
1 parent d34c40e commit f5e58cc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1693
-714
lines changed

.eslintignore

+3
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
!.eslintrc.js
2+
/node_modules
3+
/tests/fixtures
4+
/tools

.travis.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
language: node_js
2-
sudo: false
32
node_js:
43
- 6
54
- 7
@@ -8,5 +7,10 @@ node_js:
87
- 10
98
- 11
109
- 12
10+
11+
script:
12+
- if [ $TRAVIS_NODE_VERSION -ge 8 ]; then node Makefile.js lint; fi
13+
- node Makefile.js test
14+
1115
after_success:
1216
- npm run coveralls

espree.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ exports.Syntax = (function() {
154154
}
155155

156156
for (name in astNodeTypes) {
157-
if (astNodeTypes.hasOwnProperty(name)) {
157+
if (Object.hasOwnProperty.call(astNodeTypes, name)) {
158158
types[name] = astNodeTypes[name];
159159
}
160160
}

lib/espree.js

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ function normalizeEcmaVersion(ecmaVersion = DEFAULT_ECMA_VERSION) {
3535
case 8:
3636
case 9:
3737
case 10:
38+
case 11:
3839
return version;
3940

4041
// no default

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
},
1919
"license": "BSD-2-Clause",
2020
"dependencies": {
21-
"acorn": "^6.0.7",
21+
"acorn": "^7.0.0",
2222
"acorn-jsx": "^5.0.0",
23-
"eslint-visitor-keys": "^1.0.0"
23+
"eslint-visitor-keys": "^1.1.0"
2424
},
2525
"devDependencies": {
2626
"browserify": "^7.0.0",
2727
"chai": "^1.10.0",
28-
"eslint": "^5.7.0",
28+
"eslint": "^6.0.1",
2929
"eslint-config-eslint": "^5.0.1",
3030
"eslint-plugin-node": "^8.0.0",
3131
"eslint-release": "^1.0.0",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
module.exports = {
2+
"type": "Program",
3+
"loc": {
4+
"start": {
5+
"line": 1,
6+
"column": 0
7+
},
8+
"end": {
9+
"line": 1,
10+
"column": 7
11+
}
12+
},
13+
"range": [
14+
0,
15+
7
16+
],
17+
"body": [
18+
{
19+
"type": "ExpressionStatement",
20+
"loc": {
21+
"start": {
22+
"line": 1,
23+
"column": 0
24+
},
25+
"end": {
26+
"line": 1,
27+
"column": 7
28+
}
29+
},
30+
"range": [
31+
0,
32+
7
33+
],
34+
"expression": {
35+
"type": "Literal",
36+
"loc": {
37+
"start": {
38+
"line": 1,
39+
"column": 0
40+
},
41+
"end": {
42+
"line": 1,
43+
"column": 7
44+
}
45+
},
46+
"range": [
47+
0,
48+
7
49+
],
50+
"value": null,
51+
"raw": "0b0101n",
52+
"bigint": "0b0101"
53+
}
54+
}
55+
],
56+
"sourceType": "script",
57+
"tokens": [
58+
{
59+
"type": "Numeric",
60+
"value": "0b0101n",
61+
"loc": {
62+
"start": {
63+
"line": 1,
64+
"column": 0
65+
},
66+
"end": {
67+
"line": 1,
68+
"column": 7
69+
}
70+
},
71+
"range": [
72+
0,
73+
7
74+
]
75+
}
76+
]
77+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0b0101n
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
module.exports = {
2+
"type": "Program",
3+
"loc": {
4+
"start": {
5+
"line": 1,
6+
"column": 0
7+
},
8+
"end": {
9+
"line": 1,
10+
"column": 2
11+
}
12+
},
13+
"range": [
14+
0,
15+
2
16+
],
17+
"body": [
18+
{
19+
"type": "ExpressionStatement",
20+
"loc": {
21+
"start": {
22+
"line": 1,
23+
"column": 0
24+
},
25+
"end": {
26+
"line": 1,
27+
"column": 2
28+
}
29+
},
30+
"range": [
31+
0,
32+
2
33+
],
34+
"expression": {
35+
"type": "Literal",
36+
"loc": {
37+
"start": {
38+
"line": 1,
39+
"column": 0
40+
},
41+
"end": {
42+
"line": 1,
43+
"column": 2
44+
}
45+
},
46+
"range": [
47+
0,
48+
2
49+
],
50+
"value": null,
51+
"raw": "1n",
52+
"bigint": "1"
53+
}
54+
}
55+
],
56+
"sourceType": "script",
57+
"tokens": [
58+
{
59+
"type": "Numeric",
60+
"value": "1n",
61+
"loc": {
62+
"start": {
63+
"line": 1,
64+
"column": 0
65+
},
66+
"end": {
67+
"line": 1,
68+
"column": 2
69+
}
70+
},
71+
"range": [
72+
0,
73+
2
74+
]
75+
}
76+
]
77+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1n
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
module.exports = {
2+
"type": "Program",
3+
"loc": {
4+
"start": {
5+
"line": 1,
6+
"column": 0
7+
},
8+
"end": {
9+
"line": 1,
10+
"column": 5
11+
}
12+
},
13+
"range": [
14+
0,
15+
5
16+
],
17+
"body": [
18+
{
19+
"type": "ExpressionStatement",
20+
"loc": {
21+
"start": {
22+
"line": 1,
23+
"column": 0
24+
},
25+
"end": {
26+
"line": 1,
27+
"column": 5
28+
}
29+
},
30+
"range": [
31+
0,
32+
5
33+
],
34+
"expression": {
35+
"type": "Literal",
36+
"loc": {
37+
"start": {
38+
"line": 1,
39+
"column": 0
40+
},
41+
"end": {
42+
"line": 1,
43+
"column": 5
44+
}
45+
},
46+
"range": [
47+
0,
48+
5
49+
],
50+
"value": null,
51+
"raw": "0x80n",
52+
"bigint": "0x80"
53+
}
54+
}
55+
],
56+
"sourceType": "script",
57+
"tokens": [
58+
{
59+
"type": "Numeric",
60+
"value": "0x80n",
61+
"loc": {
62+
"start": {
63+
"line": 1,
64+
"column": 0
65+
},
66+
"end": {
67+
"line": 1,
68+
"column": 5
69+
}
70+
},
71+
"range": [
72+
0,
73+
5
74+
]
75+
}
76+
]
77+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0x80n
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
"index": 3,
3+
"lineNumber": 1,
4+
"column": 4,
5+
"message": "Identifier directly after number"
6+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.0n
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
module.exports = {
2+
"type": "Program",
3+
"loc": {
4+
"start": {
5+
"line": 1,
6+
"column": 0
7+
},
8+
"end": {
9+
"line": 1,
10+
"column": 6
11+
}
12+
},
13+
"range": [
14+
0,
15+
6
16+
],
17+
"body": [
18+
{
19+
"type": "ExpressionStatement",
20+
"loc": {
21+
"start": {
22+
"line": 1,
23+
"column": 0
24+
},
25+
"end": {
26+
"line": 1,
27+
"column": 6
28+
}
29+
},
30+
"range": [
31+
0,
32+
6
33+
],
34+
"expression": {
35+
"type": "Literal",
36+
"loc": {
37+
"start": {
38+
"line": 1,
39+
"column": 0
40+
},
41+
"end": {
42+
"line": 1,
43+
"column": 6
44+
}
45+
},
46+
"range": [
47+
0,
48+
6
49+
],
50+
"value": null,
51+
"raw": "0o755n",
52+
"bigint": "0o755"
53+
}
54+
}
55+
],
56+
"sourceType": "script",
57+
"tokens": [
58+
{
59+
"type": "Numeric",
60+
"value": "0o755n",
61+
"loc": {
62+
"start": {
63+
"line": 1,
64+
"column": 0
65+
},
66+
"end": {
67+
"line": 1,
68+
"column": 6
69+
}
70+
},
71+
"range": [
72+
0,
73+
6
74+
]
75+
}
76+
]
77+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0o755n

0 commit comments

Comments
 (0)