From 98d90e9e4ea19d75b82dc970cea1284801d7a6c9 Mon Sep 17 00:00:00 2001 From: Adrian Heine Date: Thu, 13 Aug 2020 14:34:15 +0200 Subject: [PATCH] Require acorn ^7.4 or ^8 --- index.js | 4 +--- overview.md | 32 ++++++++++++++++---------------- package.json | 4 +--- run_test262.js | 2 +- test/test.js | 4 ++-- test262.whitelist | 27 --------------------------- 6 files changed, 21 insertions(+), 52 deletions(-) diff --git a/index.js b/index.js index 029a686..2990923 100644 --- a/index.js +++ b/index.js @@ -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") ) } diff --git a/overview.md b/overview.md index 6d492a1..32a2df2 100644 --- a/overview.md +++ b/overview.md @@ -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 | diff --git a/package.json b/package.json index f98f0b0..e94c2ff 100644 --- a/package.json +++ b/package.json @@ -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" }, diff --git a/run_test262.js b/run_test262.js index f6dda8c..4bbe5b1 100644 --- a/run_test262.js +++ b/run_test262.js @@ -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))), diff --git a/test/test.js b/test/test.js index 05fa522..60f453d 100644 --- a/test/test.js +++ b/test/test.js @@ -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, () => { @@ -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 diff --git a/test262.whitelist b/test262.whitelist index 09242cc..d363976 100644 --- a/test262.whitelist +++ b/test262.whitelist @@ -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)