Skip to content

Commit

Permalink
Require acorn ^7.4 or ^8
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianheine committed Aug 13, 2020
1 parent 7570a41 commit 98d90e9
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 52 deletions.
4 changes: 1 addition & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

module.exports = function(Parser) {
return Parser.extend(
require("acorn-numeric-separator"),
require("acorn-class-fields"),
require("acorn-static-class-features"),
require("acorn-private-methods"),
require("acorn-logical-assignment")
require("acorn-private-methods")
)
}
32 changes: 16 additions & 16 deletions overview.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
| | ECMAScript | | acorn | | | | acorn-stage3| | |
| | 2020 | stage 3 | 6.1 | 6.2 | 7.2 | 7.3 | 2.0 | 2.1 | 3.0 |
|-----------------------|-------|---------|-----|-----|-----------|-----|-----|-----|
| dynamic-import | x | - | - | x | x | x | x | x | - |
| bigint | x | - | - | x | x | x | x | x | - |
| import-meta | x | - | - | - | x | x | x | x | - |
| export-ns-from | x | - | - | - | x | x | x | x | - |
| nullish-coalescing | x | - | - | - | x | x | - | - | - |
| optional-chaining | x | - | - | - | - | x | - | - | - |
| hashbang | - | x | x | x | x | x | - | - | - |
| top-level-await | - | x | x | x | x | x | - | - | - |
| numeric-separator | - | x | - | - | - | - | - | x | x |
| class-fields | - | x | - | - | - | - | x | x | x |
| private-methods | - | x | - | - | - | - | x | x | x |
| static-class-features | - | x | - | - | - | - | x | x | x |
| logical-assignment | - | x | - | - | - | - | - | x | x |
| | ECMAScript | | acorn | | | | acorn-stage3| | |
| | 2020 | stage 3 | 6.1 | 6.2 | 7.2 | 7.3 | 7.4 | 2.0 | 2.1 | 3.0 |
|-----------------------|-------|---------|-----|-----|-----------|-----|-----|-----|-----|
| dynamic-import | x | - | - | x | x | x | x | x | x | - |
| bigint | x | - | - | x | x | x | x | x | x | - |
| import-meta | x | - | - | - | x | x | x | x | x | - |
| export-ns-from | x | - | - | - | x | x | x | x | x | - |
| nullish-coalescing | x | - | - | - | x | x | x | - | - | - |
| optional-chaining | x | - | - | - | - | x | x | - | - | - |
| hashbang | - | x | x | x | x | x | x | - | - | - |
| top-level-await | - | x | x | x | x | x | x | - | - | - |
| numeric-separator | - | x | - | - | - | - | x | - | x | x |
| logical-assignment | - | x | - | - | - | - | x | - | x | x |
| class-fields | - | x | - | - | - | - | - | x | x | x |
| private-methods | - | x | - | - | - | - | - | x | x | x |
| static-class-features | - | x | - | - | - | - | - | x | x | x |
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@
"lint": "eslint -c .eslintrc.json ."
},
"peerDependencies": {
"acorn": "^7 || ^8"
"acorn": "^7.4 || ^8"
},
"dependencies": {
"acorn-class-fields": "^0.3.7",
"acorn-logical-assignment": "^0.1.4",
"acorn-numeric-separator": "^0.3.6",
"acorn-private-methods": "^0.3.3",
"acorn-static-class-features": "^0.2.4"
},
Expand Down
2 changes: 1 addition & 1 deletion run_test262.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const unsupportedFeatures = [
]

run(
(content, options) => Parser.parse(content, {sourceType: options.sourceType, ecmaVersion: 11, allowHashBang: true, allowAwaitOutsideFunction: true}),
(content, options) => Parser.parse(content, {sourceType: options.sourceType, ecmaVersion: 12, allowHashBang: true, allowAwaitOutsideFunction: true}),
{
testsDirectory: path.dirname(require.resolve("test262/package.json")),
skip: test => (test.attrs.features && unsupportedFeatures.some(f => test.attrs.features.includes(f))),
Expand Down
4 changes: 2 additions & 2 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const stage3 = require("..")

const Parser = acorn.Parser.extend(stage3)

const parse = testCode => Parser.parse(testCode, { ecmaVersion: 11, sourceType: "module" })
const parse = testCode => Parser.parse(testCode, { ecmaVersion: 12, sourceType: "module" })

function test(testCode, ast) {
it(testCode, () => {
Expand All @@ -19,7 +19,7 @@ function testFail(text, expectedError, additionalOptions) {
it(text, function () {
let failed = false
try {
Parser.parse(text, Object.assign({ ecmaVersion: 11, plugins: { numericSeparator: true } }, additionalOptions))
Parser.parse(text, Object.assign({ ecmaVersion: 12, additionalOptions }))
} catch (e) {
assert.strictEqual(e.message, expectedError)
failed = true
Expand Down
27 changes: 0 additions & 27 deletions test262.whitelist
Original file line number Diff line number Diff line change
@@ -1,30 +1,3 @@
built-ins/RegExp/property-escapes/generated/Emoji_Component.js (default)
built-ins/RegExp/property-escapes/generated/Emoji_Component.js (strict mode)
built-ins/RegExp/property-escapes/generated/Emoji_Modifier.js (default)
built-ins/RegExp/property-escapes/generated/Emoji_Modifier.js (strict mode)
built-ins/RegExp/property-escapes/generated/Emoji_Modifier_Base.js (default)
built-ins/RegExp/property-escapes/generated/Emoji_Modifier_Base.js (strict mode)
built-ins/RegExp/property-escapes/generated/Emoji_Presentation.js (default)
built-ins/RegExp/property-escapes/generated/Emoji_Presentation.js (strict mode)
built-ins/RegExp/property-escapes/generated/Extended_Pictographic.js (default)
built-ins/RegExp/property-escapes/generated/Extended_Pictographic.js (strict mode)
built-ins/RegExp/property-escapes/generated/Script_-_Chorasmian.js (default)
built-ins/RegExp/property-escapes/generated/Script_-_Chorasmian.js (strict mode)
built-ins/RegExp/property-escapes/generated/Script_-_Dives_Akuru.js (default)
built-ins/RegExp/property-escapes/generated/Script_-_Dives_Akuru.js (strict mode)
built-ins/RegExp/property-escapes/generated/Script_-_Khitan_Small_Script.js (default)
built-ins/RegExp/property-escapes/generated/Script_-_Khitan_Small_Script.js (strict mode)
built-ins/RegExp/property-escapes/generated/Script_-_Yezidi.js (default)
built-ins/RegExp/property-escapes/generated/Script_-_Yezidi.js (strict mode)
built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Chorasmian.js (default)
built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Chorasmian.js (strict mode)
built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Dives_Akuru.js (default)
built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Dives_Akuru.js (strict mode)
built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Khitan_Small_Script.js (default)
built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Khitan_Small_Script.js (strict mode)
built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Yezidi.js (default)
built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Yezidi.js (strict mode)

language/expressions/await/await-BindingIdentifier-in-global.js (default)
language/expressions/await/await-BindingIdentifier-in-global.js (strict mode)
language/expressions/await/await-in-global.js (default)
Expand Down

0 comments on commit 98d90e9

Please sign in to comment.