Skip to content

Commit 3c5adc8

Browse files
committed
Update acorn, remove unused acorn plugins
1 parent 4ac53fa commit 3c5adc8

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

package.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,15 @@
77
"url": "https://github.com/browserify/acorn-node/issues"
88
},
99
"dependencies": {
10-
"acorn": "^7.4.0",
11-
"acorn-walk": "^7.2.0",
10+
"acorn": "^8.8.2",
11+
"acorn-walk": "^8.2.0",
1212
"setprototypeof": "^1.2.0",
1313
"xtend": "^4.0.2"
1414
},
1515
"devDependencies": {
1616
"@babel/cli": "^7.10.1",
1717
"@babel/core": "^7.10.1",
1818
"@babel/preset-env": "^7.10.1",
19-
"acorn-class-fields": "^0.3.4",
20-
"acorn-private-class-elements": "^0.2.5",
21-
"acorn-static-class-features": "^0.2.2",
2219
"mkdirp": "^0.5.5",
2320
"npm-run-all": "^4.1.5",
2421
"standard": "^13.1.0",
@@ -41,9 +38,6 @@
4138
"lint": "standard",
4239
"test": "node test",
4340
"prepare": "npm run build && node test",
44-
"build:acorn-class-fields": "babel node_modules/acorn-class-fields --out-dir lib/acorn-class-fields",
45-
"build:acorn-static-class-features": "babel node_modules/acorn-static-class-features --out-dir lib/acorn-static-class-features",
46-
"build:acorn-private-class-elements": "babel node_modules/acorn-private-class-elements --out-dir lib/acorn-private-class-elements",
4741
"build:self": "babel src --out-dir .",
4842
"build": "npm-run-all --parallel build:*"
4943
},

src/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1+
'use strict'
2+
13
var acorn = require('acorn')
24

35
var CJSParser = acorn.Parser
46
// Required paths should be relative to the package root, because Babel outputs this file there.
5-
.extend(require('./lib/acorn-class-fields'))
6-
.extend(require('./lib/acorn-static-class-features'))
7+
// .extend(require('./lib/acorn-class-fields'))
8+
// .extend(require('./lib/acorn-static-class-features'))
79
.extend(defaultOptionsPlugin)
810
var ESModulesParser = CJSParser
911

1012
function mapOptions (opts) {
1113
if (!opts) opts = {}
1214
return {
13-
ecmaVersion: 2021,
15+
ecmaVersion: 2022,
1416
allowHashBang: true,
1517
allowReturnOutsideFunction: true,
1618
...opts

test/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ test('parses object spread syntax', function (t) {
1717

1818
test('does not change main acorn module', function (t) {
1919
t.throws(function () {
20-
baseAcorn.parse('var a = 10n')
20+
baseAcorn.parse('return 10n', { ecmaVersion: 2022 })
2121
})
2222
t.end()
2323
})

0 commit comments

Comments
 (0)