From 9a66ebc113223128dd1d94fe67a53a54837ef691 Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Thu, 11 Jun 2020 01:34:50 -0700 Subject: [PATCH 1/8] Acorn 7.3.0 upgrade --- package.json | 3 +-- src/Graph.ts | 2 +- src/Module.ts | 2 +- src/ModuleLoader.ts | 2 +- src/utils/pureComments.ts | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index bf120b674b6..74d46fd7ef7 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "@types/require-relative": "^0.8.0", "@types/signal-exit": "^3.0.0", "@types/yargs-parser": "^15.0.0", - "acorn": "^7.2.0", + "acorn": "^7.3.0", "acorn-class-fields": "^0.3.4", "acorn-import-meta": "^1.1.0", "acorn-jsx": "^5.2.0", @@ -94,7 +94,6 @@ "eslint-plugin-import": "^2.21.1", "execa": "^4.0.2", "fixturify": "^2.1.0", - "fork-acorn-optional-chaining": "^7.2.0", "hash.js": "^1.1.7", "husky": "^4.2.5", "is-reference": "^1.2.0", diff --git a/src/Graph.ts b/src/Graph.ts index f11a0843f39..85afcfd793f 100644 --- a/src/Graph.ts +++ b/src/Graph.ts @@ -1,4 +1,4 @@ -import * as acorn from 'fork-acorn-optional-chaining'; +import * as acorn from 'acorn'; import GlobalScope from './ast/scopes/GlobalScope'; import { PathTracker } from './ast/utils/PathTracker'; import Chunk from './Chunk'; diff --git a/src/Module.ts b/src/Module.ts index 941a5594d09..bf1788c8b01 100644 --- a/src/Module.ts +++ b/src/Module.ts @@ -1,4 +1,4 @@ -import * as acorn from 'fork-acorn-optional-chaining'; +import * as acorn from 'acorn'; import { locate } from 'locate-character'; import MagicString from 'magic-string'; import extractAssignedNames from 'rollup-pluginutils/src/extractAssignedNames'; diff --git a/src/ModuleLoader.ts b/src/ModuleLoader.ts index f5f71a3ea55..d51977e39c1 100644 --- a/src/ModuleLoader.ts +++ b/src/ModuleLoader.ts @@ -1,4 +1,4 @@ -import * as acorn from 'fork-acorn-optional-chaining'; +import * as acorn from 'acorn'; import ExternalModule from './ExternalModule'; import Graph from './Graph'; import Module from './Module'; diff --git a/src/utils/pureComments.ts b/src/utils/pureComments.ts index e2f52165b49..4404150a769 100644 --- a/src/utils/pureComments.ts +++ b/src/utils/pureComments.ts @@ -1,6 +1,6 @@ // @ts-ignore +import * as acorn from 'acorn'; import { base as basicWalker } from 'acorn-walk'; -import * as acorn from 'fork-acorn-optional-chaining'; import { CommentDescription } from '../Module'; // patch up acorn-walk until class-fields are officially supported From 5e3ddfd34b974c3c4d835c26180118a6738dd597 Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Thu, 11 Jun 2020 01:42:35 -0700 Subject: [PATCH 2/8] retain fork for previous build, lock file update --- package-lock.json | 6 +++--- package.json | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index c20637fb152..531d5e34fcb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -539,9 +539,9 @@ "dev": true }, "acorn": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.2.0.tgz", - "integrity": "sha512-apwXVmYVpQ34m/i71vrApRrRKCWQnZZF1+npOD0WV5xZFfwWOmKGQ2RWlfdy9vWITsenisM8M0Qeq8agcFHNiQ==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.3.0.tgz", + "integrity": "sha512-Q/reetejf1Yf8vY7wyZI8DOsrMr9r7RfnDYBVjIdE61Rk8atUkbV1Kyi/diJzgAWiDiHEPWpNoqpPb+2CUbudQ==", "dev": true }, "acorn-class-fields": { diff --git a/package.json b/package.json index 74d46fd7ef7..782ad5b53d2 100644 --- a/package.json +++ b/package.json @@ -94,6 +94,7 @@ "eslint-plugin-import": "^2.21.1", "execa": "^4.0.2", "fixturify": "^2.1.0", + "fork-acorn-optional-chaining": "^7.2.0", "hash.js": "^1.1.7", "husky": "^4.2.5", "is-reference": "^1.2.0", From 9170b6a6c503892aaad6cf89a61463e27aa58b4d Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Thu, 11 Jun 2020 02:07:40 -0700 Subject: [PATCH 3/8] walker typing work-around --- src/utils/pureComments.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/utils/pureComments.ts b/src/utils/pureComments.ts index 4404150a769..4f044faa87f 100644 --- a/src/utils/pureComments.ts +++ b/src/utils/pureComments.ts @@ -1,10 +1,12 @@ // @ts-ignore import * as acorn from 'acorn'; -import { base as basicWalker } from 'acorn-walk'; +import * as acornWalk from 'acorn-walk'; import { CommentDescription } from '../Module'; +const base = (acornWalk as any).base; + // patch up acorn-walk until class-fields are officially supported -basicWalker.FieldDefinition = function (node: any, st: any, c: any) { +base.FieldDefinition = function (node: any, st: any, c: any) { if (node.computed) { c(node.key, st, 'Expression'); } @@ -24,7 +26,7 @@ function handlePureAnnotationsOfNode( commentNode = state.commentNodes[++state.commentIndex]; } if (commentNode && commentNode.end <= node.end) { - basicWalker[type](node, state, handlePureAnnotationsOfNode); + base[type](node, state, handlePureAnnotationsOfNode); } } From 12d82c67ed25ca303db96698adba68bd3a84e19f Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Thu, 11 Jun 2020 15:09:00 -0700 Subject: [PATCH 4/8] 7.3.1 --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 531d5e34fcb..641fd9b1fd5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -539,9 +539,9 @@ "dev": true }, "acorn": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.3.0.tgz", - "integrity": "sha512-Q/reetejf1Yf8vY7wyZI8DOsrMr9r7RfnDYBVjIdE61Rk8atUkbV1Kyi/diJzgAWiDiHEPWpNoqpPb+2CUbudQ==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.3.1.tgz", + "integrity": "sha512-tLc0wSnatxAQHVHUapaHdz72pi9KUyHjq5KyHjGg9Y8Ifdc79pTh2XvI6I1/chZbnM7QtNKzh66ooDogPZSleA==", "dev": true }, "acorn-class-fields": { diff --git a/package.json b/package.json index 782ad5b53d2..494aa7f6e0f 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "@types/require-relative": "^0.8.0", "@types/signal-exit": "^3.0.0", "@types/yargs-parser": "^15.0.0", - "acorn": "^7.3.0", + "acorn": "^7.3.1", "acorn-class-fields": "^0.3.4", "acorn-import-meta": "^1.1.0", "acorn-jsx": "^5.2.0", From 5b37f727d085c2aac6ae45e194a756ca2d626b00 Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Fri, 12 Jun 2020 00:56:11 -0700 Subject: [PATCH 5/8] update acorn plugins --- package-lock.json | 28 +++++++++------------- package.json | 5 ++-- src/utils/options/normalizeInputOptions.ts | 2 -- 3 files changed, 13 insertions(+), 22 deletions(-) diff --git a/package-lock.json b/package-lock.json index 641fd9b1fd5..5c5e4ac804a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -545,12 +545,12 @@ "dev": true }, "acorn-class-fields": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/acorn-class-fields/-/acorn-class-fields-0.3.4.tgz", - "integrity": "sha512-yqUCIu0UJHFmCVhH3Cq29UR+3OJo1CtNWf1ncxTf3KfdEDt7aD0iVYmX7UN+RvIHyOsgukzplQhNkgePtASLUw==", + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/acorn-class-fields/-/acorn-class-fields-0.3.6.tgz", + "integrity": "sha512-nOzMl1byCFAJLgxNUG7QorpzRHWlkBKVSSOMKUu+bVbVZG5lU4NZkOp/uA7CnE+NAsWhmxTsMgQdHsQXUO8Ulg==", "dev": true, "requires": { - "acorn-private-class-elements": "^0.2.5" + "acorn-private-class-elements": "^0.2.6" } }, "acorn-dynamic-import": { @@ -559,12 +559,6 @@ "integrity": "sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw==", "dev": true }, - "acorn-import-meta": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/acorn-import-meta/-/acorn-import-meta-1.1.0.tgz", - "integrity": "sha512-pshgiVR5mhpjFVdizKTN+kAGRqjJFUOEB3TvpQ6kiAutb1lvHrIVVcGoe5xzMpJkVNifCeymMG7/tsDkWn8CdQ==", - "dev": true - }, "acorn-jsx": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", @@ -572,18 +566,18 @@ "dev": true }, "acorn-private-class-elements": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/acorn-private-class-elements/-/acorn-private-class-elements-0.2.5.tgz", - "integrity": "sha512-3eApRrJmPjaxWB3XidP8YMeVq9pcswPFE0KsSWVuhceCU68ZS8fkcf0fTXGhCmnNd7n48NWWV27EKMFPeCoJLg==", + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/acorn-private-class-elements/-/acorn-private-class-elements-0.2.6.tgz", + "integrity": "sha512-PV+AhOU1/vCx5zIBgGYLB5+OoT8IPKZUcWEGdLBTQgFBMMzPM9S5SKSG4EdiuULqoq3pV3C07rGuSC1Y5gbi/g==", "dev": true }, "acorn-static-class-features": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/acorn-static-class-features/-/acorn-static-class-features-0.2.2.tgz", - "integrity": "sha512-B7aWeS7MXqdgP3RnettN/CFz7HevAlQWfh5zkc3LJzeCQoF1InTzYBCfkkbmit1p0pmCEB8IG05gB62pOm5lvA==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/acorn-static-class-features/-/acorn-static-class-features-0.2.3.tgz", + "integrity": "sha512-N7yRI9NduTJRam3BQTXHLR63ykHQv2MnxWTRq0+4PfQosGUz/tM0/ToRqWUqGphP960mDTm/7zJFx3dB/AZtiw==", "dev": true, "requires": { - "acorn-private-class-elements": "^0.2.3" + "acorn-private-class-elements": "^0.2.6" } }, "acorn-walk": { diff --git a/package.json b/package.json index 494aa7f6e0f..56682aa8ad2 100644 --- a/package.json +++ b/package.json @@ -76,10 +76,9 @@ "@types/signal-exit": "^3.0.0", "@types/yargs-parser": "^15.0.0", "acorn": "^7.3.1", - "acorn-class-fields": "^0.3.4", - "acorn-import-meta": "^1.1.0", + "acorn-class-fields": "^0.3.6", "acorn-jsx": "^5.2.0", - "acorn-static-class-features": "^0.2.2", + "acorn-static-class-features": "^0.2.3", "acorn-walk": "^7.1.1", "buble": "^0.20.0", "chokidar": "^3.4.0", diff --git a/src/utils/options/normalizeInputOptions.ts b/src/utils/options/normalizeInputOptions.ts index 152477a1417..1086b942ef3 100644 --- a/src/utils/options/normalizeInputOptions.ts +++ b/src/utils/options/normalizeInputOptions.ts @@ -1,5 +1,4 @@ import injectClassFields from 'acorn-class-fields'; -import injectImportMeta from 'acorn-import-meta'; import injectStaticClassFeatures from 'acorn-static-class-features'; import { ExternalOption, @@ -114,7 +113,6 @@ const getAcorn = (config: GenericConfigObject): acorn.Options => ({ }); const getAcornInjectPlugins = (config: GenericConfigObject): Function[] => [ - injectImportMeta, injectClassFields, injectStaticClassFeatures, ...(ensureArray(config.acornInjectPlugins) as any) From e4f3025bfb986f8fb8e37a8b52b04e507700f1cd Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Fri, 12 Jun 2020 01:11:09 -0700 Subject: [PATCH 6/8] fixup hook test --- test/function/samples/options-hook/_config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/function/samples/options-hook/_config.js b/test/function/samples/options-hook/_config.js index 230a403ca1d..6b30e1daccc 100644 --- a/test/function/samples/options-hook/_config.js +++ b/test/function/samples/options-hook/_config.js @@ -15,7 +15,7 @@ module.exports = { preserveParens: false, sourceType: 'module' }, - acornInjectPlugins: [null, null, null], + acornInjectPlugins: [null, null], context: 'undefined', experimentalCacheExpiry: 10, inlineDynamicImports: false, From f66c16827f5e3ac7f6bb8ad6740ca8a58f8465a1 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Fri, 12 Jun 2020 21:36:58 +0200 Subject: [PATCH 7/8] Get rid of acorn fork, introduce missing ChainExpression node to fix test --- LICENSE.md | 39 +++++--------------------------- package-lock.json | 6 ----- package.json | 1 - rollup.config.js | 3 +-- src/ast/nodes/ChainExpression.ts | 9 ++++++++ src/ast/nodes/NodeType.ts | 2 ++ src/ast/nodes/index.ts | 2 ++ src/utils/pureComments.ts | 10 ++++---- 8 files changed, 24 insertions(+), 48 deletions(-) create mode 100644 src/ast/nodes/ChainExpression.ts diff --git a/LICENSE.md b/LICENSE.md index b362d602a05..cdbe1bcf8b9 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -28,12 +28,12 @@ The published Rollup artifact additionally contains code with the following lice MIT, ISC # Bundled dependencies: -## acorn-class-fields +## acorn License: MIT -By: Adrian Heine -Repository: https://github.com/acornjs/acorn-class-fields +By: Marijn Haverbeke, Ingvar Stepanyan, Adrian Heine +Repository: https://github.com/acornjs/acorn.git -> Copyright (C) 2017-2018 by Adrian Heine +> Copyright (C) 2012-2018 by various contributors (see AUTHORS) > > Permission is hereby granted, free of charge, to any person obtaining a copy > of this software and associated documentation files (the "Software"), to deal @@ -55,10 +55,10 @@ Repository: https://github.com/acornjs/acorn-class-fields --------------------------------------- -## acorn-import-meta +## acorn-class-fields License: MIT By: Adrian Heine -Repository: https://github.com/adrianheine/acorn-import-meta +Repository: https://github.com/acornjs/acorn-class-fields > Copyright (C) 2017-2018 by Adrian Heine > @@ -316,33 +316,6 @@ Repository: jonschlinkert/fill-range --------------------------------------- -## fork-acorn-optional-chaining -License: MIT -By: Marijn Haverbeke, Ingvar Stepanyan, Adrian Heine -Repository: https://github.com/acornjs/acorn.git - -> Copyright (C) 2012-2018 by various contributors (see AUTHORS) -> -> Permission is hereby granted, free of charge, to any person obtaining a copy -> of this software and associated documentation files (the "Software"), to deal -> in the Software without restriction, including without limitation the rights -> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -> copies of the Software, and to permit persons to whom the Software is -> furnished to do so, subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in -> all copies or substantial portions of the Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -> THE SOFTWARE. - ---------------------------------------- - ## glob-parent License: ISC By: Gulp Team, Elan Shanker, Blaine Bublitz diff --git a/package-lock.json b/package-lock.json index 5c5e4ac804a..1a4f626981d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1831,12 +1831,6 @@ "signal-exit": "^3.0.2" } }, - "fork-acorn-optional-chaining": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/fork-acorn-optional-chaining/-/fork-acorn-optional-chaining-7.2.0.tgz", - "integrity": "sha512-WM85polHQ1XC5XZ/CWBgaFBjKZ2ooTS42Xcp2vpAemHRNubRG6lGZ5ViTcS5pBh9x5VL2yS2gUO3FVwr9vSA+w==", - "dev": true - }, "fromentries": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.2.0.tgz", diff --git a/package.json b/package.json index 56682aa8ad2..cb5bcaf7fca 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,6 @@ "eslint-plugin-import": "^2.21.1", "execa": "^4.0.2", "fixturify": "^2.1.0", - "fork-acorn-optional-chaining": "^7.2.0", "hash.js": "^1.1.7", "husky": "^4.2.5", "is-reference": "^1.2.0", diff --git a/rollup.config.js b/rollup.config.js index 8374803a285..28445f9c021 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -49,8 +49,7 @@ const moduleAliases = { resolve: ['.js', '.json', '.md'], entries: [ { find: 'help.md', replacement: path.resolve('cli/help.md') }, - { find: 'package.json', replacement: path.resolve('package.json') }, - {find: 'acorn', replacement: 'fork-acorn-optional-chaining'} + { find: 'package.json', replacement: path.resolve('package.json') } ] }; diff --git a/src/ast/nodes/ChainExpression.ts b/src/ast/nodes/ChainExpression.ts new file mode 100644 index 00000000000..77c8a021819 --- /dev/null +++ b/src/ast/nodes/ChainExpression.ts @@ -0,0 +1,9 @@ +import CallExpression from './CallExpression'; +import MemberExpression from './MemberExpression'; +import * as NodeType from './NodeType'; +import { NodeBase } from './shared/Node'; + +export default class ChainExpression extends NodeBase { + expression!: CallExpression | MemberExpression; + type!: NodeType.tChainExpression; +} diff --git a/src/ast/nodes/NodeType.ts b/src/ast/nodes/NodeType.ts index 894f007c29f..3f5c69a85eb 100644 --- a/src/ast/nodes/NodeType.ts +++ b/src/ast/nodes/NodeType.ts @@ -9,6 +9,7 @@ export type tBlockStatement = 'BlockStatement'; export type tBreakStatement = 'BreakStatement'; export type tCallExpression = 'CallExpression'; export type tCatchClause = 'CatchClause'; +export type tChainExpression = 'ChainExpression'; export type tClassBody = 'ClassBody'; export type tClassDeclaration = 'ClassDeclaration'; export type tClassExpression = 'ClassExpression'; @@ -78,6 +79,7 @@ export const BlockStatement: tBlockStatement = 'BlockStatement'; export const BreakStatement: tBreakStatement = 'BreakStatement'; export const CallExpression: tCallExpression = 'CallExpression'; export const CatchClause: tCatchClause = 'CatchClause'; +export const ChainExpression: tChainExpression = 'ChainExpression'; export const ClassBody: tClassBody = 'ClassBody'; export const ClassDeclaration: tClassDeclaration = 'ClassDeclaration'; export const ClassExpression: tClassExpression = 'ClassExpression'; diff --git a/src/ast/nodes/index.ts b/src/ast/nodes/index.ts index 3b7ecc5fc96..c5642b92499 100644 --- a/src/ast/nodes/index.ts +++ b/src/ast/nodes/index.ts @@ -9,6 +9,7 @@ import BlockStatement from './BlockStatement'; import BreakStatement from './BreakStatement'; import CallExpression from './CallExpression'; import CatchClause from './CatchClause'; +import ChainExpression from './ChainExpression'; import ClassBody from './ClassBody'; import ClassDeclaration from './ClassDeclaration'; import ClassExpression from './ClassExpression'; @@ -82,6 +83,7 @@ export const nodeConstructors: { BreakStatement, CallExpression, CatchClause, + ChainExpression, ClassBody, ClassDeclaration, ClassExpression, diff --git a/src/utils/pureComments.ts b/src/utils/pureComments.ts index 4f044faa87f..c45336a4520 100644 --- a/src/utils/pureComments.ts +++ b/src/utils/pureComments.ts @@ -1,12 +1,10 @@ -// @ts-ignore import * as acorn from 'acorn'; -import * as acornWalk from 'acorn-walk'; +// @ts-ignore +import { base as basicWalker } from 'acorn-walk'; import { CommentDescription } from '../Module'; -const base = (acornWalk as any).base; - // patch up acorn-walk until class-fields are officially supported -base.FieldDefinition = function (node: any, st: any, c: any) { +basicWalker.FieldDefinition = function (node: any, st: any, c: any) { if (node.computed) { c(node.key, st, 'Expression'); } @@ -26,7 +24,7 @@ function handlePureAnnotationsOfNode( commentNode = state.commentNodes[++state.commentIndex]; } if (commentNode && commentNode.end <= node.end) { - base[type](node, state, handlePureAnnotationsOfNode); + basicWalker[type](node, state, handlePureAnnotationsOfNode); } } From aaa0b1f53e22507221710ddc904079a91a8150dd Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Fri, 12 Jun 2020 21:41:15 +0200 Subject: [PATCH 8/8] Fix type with regard to ESTree types --- src/ast/nodes/CallExpression.ts | 2 +- src/ast/nodes/MemberExpression.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ast/nodes/CallExpression.ts b/src/ast/nodes/CallExpression.ts index 8cf4a67d393..2bf7a1c5e4f 100644 --- a/src/ast/nodes/CallExpression.ts +++ b/src/ast/nodes/CallExpression.ts @@ -29,7 +29,7 @@ export default class CallExpression extends NodeBase implements DeoptimizableEnt annotatedPure?: boolean; arguments!: (ExpressionNode | SpreadElement)[]; callee!: ExpressionNode | Super; - optional?: boolean; + optional!: boolean; type!: NodeType.tCallExpression; private callOptions!: CallOptions; diff --git a/src/ast/nodes/MemberExpression.ts b/src/ast/nodes/MemberExpression.ts index 11a4c3642ec..8d88d357ef3 100644 --- a/src/ast/nodes/MemberExpression.ts +++ b/src/ast/nodes/MemberExpression.ts @@ -73,7 +73,7 @@ function getStringFromPath(path: PathWithPositions): string { export default class MemberExpression extends NodeBase implements DeoptimizableEntity, PatternNode { computed!: boolean; object!: ExpressionNode | Super; - optional?: boolean; + optional!: boolean; property!: ExpressionNode; propertyKey!: ObjectPathKey | null; type!: NodeType.tMemberExpression;