diff --git a/packages/babel-parser/ast/spec.md b/packages/babel-parser/ast/spec.md index 0e005fd2295e..a6fb48d138cf 100644 --- a/packages/babel-parser/ast/spec.md +++ b/packages/babel-parser/ast/spec.md @@ -1235,6 +1235,7 @@ interface ClassProperty <: Node { value: Expression; static: boolean; computed: boolean; + accessor: boolean; } ``` diff --git a/packages/babel-parser/package.json b/packages/babel-parser/package.json index b363789aee52..c1eee12aeb39 100644 --- a/packages/babel-parser/package.json +++ b/packages/babel-parser/package.json @@ -4,7 +4,7 @@ "description": "A JavaScript parser", "author": "The Babel Team (https://babel.dev/team)", "homepage": "https://babel.dev/docs/en/next/babel-parser", - "bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A+parser+%28babylon%29%22+is%3Aopen", + "bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A+parser+%28bab;lon%29%22+is%3Aopen", "license": "MIT", "publishConfig": { "access": "public" diff --git a/packages/babel-parser/src/parser/statement.js b/packages/babel-parser/src/parser/statement.js index 8634676ca4e4..d52119806e21 100644 --- a/packages/babel-parser/src/parser/statement.js +++ b/packages/babel-parser/src/parser/statement.js @@ -1373,6 +1373,7 @@ export default class StatementParser extends ExpressionParser { prop.computed = false; prop.key = key; prop.static = false; + prop.accessor = false; classBody.body.push(this.parseClassProperty(prop)); return true; } @@ -1409,10 +1410,11 @@ export default class StatementParser extends ExpressionParser { ) { const publicMethod: $FlowSubtype = member; const privateMethod: $FlowSubtype = member; - const publicProp: $FlowSubtype = member; - const privateProp: $FlowSubtype = member; + const publicProp: $FlowSubtype = member; + const privateProp: $FlowSubtype = member; const method: typeof publicMethod | typeof privateMethod = publicMethod; + const prop: typeof publicProp | typeof privateProp = publicProp; const publicMember: typeof publicMethod | typeof publicProp = publicMethod; member.static = isStatic; @@ -1486,6 +1488,8 @@ export default class StatementParser extends ExpressionParser { allowsDirectSuper, ); } else if (this.isClassProperty()) { + prop.accessor = false; + if (isPrivate) { this.pushClassPrivateProperty(classBody, privateProp); } else { @@ -1563,6 +1567,24 @@ export default class StatementParser extends ExpressionParser { } this.checkGetterSetterParams(publicMethod); + } else if ( + isContextual && + key.name === "accessor" && + !this.isLineTerminator() + ) { + this.resetPreviousNodeTrailingComments(key); + + // The so-called parsed name would have been "get/set": get the real name. + const isPrivate = this.match(tt.privateName); + this.parseClassElementName(publicProp); + + prop.accessor = true; + + if (isPrivate) { + this.pushClassPrivateProperty(classBody, privateProp); + } else { + this.pushClassProperty(classBody, publicProp); + } } else if (this.isLineTerminator()) { // an uninitialized class property (due to ASI, since we don't otherwise recognize the next token) if (isPrivate) { diff --git a/packages/babel-parser/src/types.js b/packages/babel-parser/src/types.js index cef0987a6864..3419678d89ec 100644 --- a/packages/babel-parser/src/types.js +++ b/packages/babel-parser/src/types.js @@ -813,6 +813,7 @@ export type ClassProperty = ClassMemberBase & type: "ClassProperty", key: Expression, value: ?Expression, // TODO: Not in spec that this is nullable. + accessor: boolean, typeAnnotation?: ?TypeAnnotationBase, // TODO: Not in spec variance?: ?FlowVariance, // TODO: Not in spec @@ -828,6 +829,7 @@ export type ClassPrivateProperty = NodeBase & { value: ?Expression, // TODO: Not in spec that this is nullable. static: boolean, computed: false, + accessor: boolean, // Flow and Typescript typeAnnotation?: ?TypeAnnotationBase, diff --git a/packages/babel-parser/test/fixtures/core/opts/private-name-tokens-true-babel-7/output.json b/packages/babel-parser/test/fixtures/core/opts/private-name-tokens-true-babel-7/output.json index 44c9bc391f90..c0f2e2288fd2 100644 --- a/packages/babel-parser/test/fixtures/core/opts/private-name-tokens-true-babel-7/output.json +++ b/packages/babel-parser/test/fixtures/core/opts/private-name-tokens-true-babel-7/output.json @@ -33,6 +33,7 @@ "name": "p" } }, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-methods/combined/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-methods/combined/output.json index d423f26aebbf..9ffb95f8995f 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-methods/combined/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-methods/combined/output.json @@ -30,6 +30,7 @@ "name": "a" }, "computed": false, + "accessor": false, "value": { "type": "NumericLiteral", "start":18,"end":19,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7}}, @@ -98,6 +99,7 @@ "name": "b" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":61,"end":62,"loc":{"start":{"line":8,"column":7},"end":{"line":8,"column":8}}, @@ -222,12 +224,12 @@ "start":139,"end":143,"loc":{"start":{"line":14,"column":11},"end":{"line":14,"column":15},"identifierName":"Math"}, "name": "Math" }, + "computed": false, "property": { "type": "Identifier", "start":144,"end":150,"loc":{"start":{"line":14,"column":16},"end":{"line":14,"column":22},"identifierName":"random"}, "name": "random" - }, - "computed": false + } }, "arguments": [] } diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-instance-field/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-instance-field/output.json index af6eb7d2c51b..a0724b1687cd 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-instance-field/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-instance-field/output.json @@ -36,6 +36,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, @@ -59,6 +60,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":27,"end":28,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-instance-get/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-instance-get/output.json index 8dce1b38bc14..ac1a810a9c17 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-instance-get/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-instance-get/output.json @@ -36,6 +36,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-instance-method/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-instance-method/output.json index b5862a6b8146..6f420759f284 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-instance-method/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-instance-method/output.json @@ -36,6 +36,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-instance-set/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-instance-set/output.json index fc6048287240..751b97fcf7c7 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-instance-set/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-instance-set/output.json @@ -36,6 +36,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-static-field/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-static-field/output.json index 6371085f100a..e551f7a6ff22 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-static-field/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-static-field/output.json @@ -36,6 +36,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, @@ -59,6 +60,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":34,"end":35,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-static-get/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-static-get/output.json index 18306486f988..aac24e4d9351 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-static-get/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-static-get/output.json @@ -36,6 +36,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-static-method/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-static-method/output.json index 04004e559883..57be6490d765 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-static-method/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-static-method/output.json @@ -36,6 +36,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-static-set/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-static-set/output.json index 7a8bc1a7c152..2fa20d8ac371 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-static-set/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-static-set/output.json @@ -36,6 +36,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-instance-field/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-instance-field/output.json index ca2586e44fd1..2616623006e3 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-instance-field/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-instance-field/output.json @@ -62,6 +62,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":31,"end":32,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-static-field/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-static-field/output.json index 800e063a7471..4197efd7200b 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-static-field/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-static-field/output.json @@ -62,6 +62,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":38,"end":39,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-instance-field/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-instance-field/output.json index 8aa9ca183d5e..e52896e2eb39 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-instance-field/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-instance-field/output.json @@ -61,6 +61,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":27,"end":28,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-static-field/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-static-field/output.json index d438c0b744a2..285fd71ac88c 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-static-field/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-static-field/output.json @@ -61,6 +61,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":34,"end":35,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-instance-field/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-instance-field/output.json index 2a05ac112df1..e0c8c499fc18 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-instance-field/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-instance-field/output.json @@ -68,6 +68,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":32,"end":33,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-static-field/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-static-field/output.json index 5fe8a5e63ea8..63cdc5f3008d 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-static-field/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-static-field/output.json @@ -68,6 +68,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":39,"end":40,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-instance-field/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-instance-field/output.json index 03f017ec7c5e..b0030f5c41e1 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-instance-field/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-instance-field/output.json @@ -36,6 +36,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15}}, @@ -59,6 +60,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":34,"end":35,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-instance-get/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-instance-get/output.json index f3c0d841ff7c..ae49481db1eb 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-instance-get/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-instance-get/output.json @@ -36,6 +36,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-instance-method/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-instance-method/output.json index 1678907e09cf..c15ecf95dd0b 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-instance-method/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-instance-method/output.json @@ -36,6 +36,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-instance-set/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-instance-set/output.json index 840a1bf6dbdc..b7d02df470e5 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-instance-set/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-instance-set/output.json @@ -36,6 +36,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-static-field/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-static-field/output.json index faa8169fb638..8f6a5e078ddd 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-static-field/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-static-field/output.json @@ -36,6 +36,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15}}, @@ -59,6 +60,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":41,"end":42,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-static-get/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-static-get/output.json index a30c50be62c4..c4e31c1819eb 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-static-get/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-static-get/output.json @@ -36,6 +36,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-static-method/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-static-method/output.json index 2d24e647ce85..4c78a6e27958 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-static-method/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-static-method/output.json @@ -36,6 +36,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-static-set/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-static-set/output.json index 54b6269e86c5..3f057938f04b 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-static-set/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-static-set/output.json @@ -36,6 +36,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-instance-field/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-instance-field/output.json index 76caf4c4294d..fc6cbae2a836 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-instance-field/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-instance-field/output.json @@ -62,6 +62,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":38,"end":39,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-static-field/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-static-field/output.json index beda39cd6916..15a607fa7056 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-static-field/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-static-field/output.json @@ -62,6 +62,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":45,"end":46,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-instance-field/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-instance-field/output.json index 8c8bdac35c76..8c3871156973 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-instance-field/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-instance-field/output.json @@ -61,6 +61,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":34,"end":35,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-static-field/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-static-field/output.json index 205ca13bb432..230246dbe9db 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-static-field/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-static-field/output.json @@ -61,6 +61,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":41,"end":42,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-instance-field/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-instance-field/output.json index 159cc7f879a3..ab526d231208 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-instance-field/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-instance-field/output.json @@ -68,6 +68,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":39,"end":40,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-static-field/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-static-field/output.json index 77fe62df3d1c..597ba90cecea 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-static-field/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-static-field/output.json @@ -68,6 +68,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":46,"end":47,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/asi-success/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/asi-success/output.json index 84dfd671cc3d..11bc9a871c4e 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/asi-success/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/asi-success/output.json @@ -48,6 +48,7 @@ "name": "y" } }, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/await-identifier-in-property-in-arguments-of-async-call/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/await-identifier-in-property-in-arguments-of-async-call/output.json index eba6cca0dbf9..6da66a9710b7 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/await-identifier-in-property-in-arguments-of-async-call/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/await-identifier-in-property-in-arguments-of-async-call/output.json @@ -50,6 +50,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "Identifier", "start":24,"end":29,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":29},"identifierName":"await"}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/await-in-async-in-private-property/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/await-in-async-in-private-property/output.json index 51393c7016b5..a427de9064bd 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/await-in-async-in-private-property/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/await-in-async-in-private-property/output.json @@ -33,6 +33,7 @@ "name": "p" } }, + "accessor": false, "value": { "type": "ArrowFunctionExpression", "start":17,"end":37,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":27}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/await-in-private-property-in-async/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/await-in-private-property-in-async/output.json index 43274b4f1ab2..4c06020694ad 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/await-in-private-property-in-async/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/await-in-private-property-in-async/output.json @@ -37,6 +37,13 @@ { "type": "ClassPrivateProperty", "start":75,"end":91,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":20}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": " here await is an identifier reference", + "start":30,"end":70,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":44}} + } + ], "static": false, "key": { "type": "PrivateName", @@ -47,6 +54,7 @@ "name": "p" } }, + "accessor": false, "value": { "type": "BinaryExpression", "start":80,"end":90,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":19}}, @@ -65,14 +73,7 @@ }, "value": 42 } - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " here await is an identifier reference", - "start":30,"end":70,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":44}} - } - ] + } } ] } diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/await-in-private-property-in-params-of-async-arrow/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/await-in-private-property-in-params-of-async-arrow/output.json index 1876bbfd5cbd..e13d6516aa45 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/await-in-private-property-in-params-of-async-arrow/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/await-in-private-property-in-params-of-async-arrow/output.json @@ -47,6 +47,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "Identifier", "start":24,"end":29,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":29},"identifierName":"await"}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/declared-later-outer-class/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/declared-later-outer-class/output.json index 61bcf07c5a6b..100e90b590d4 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/declared-later-outer-class/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/declared-later-outer-class/output.json @@ -65,6 +65,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "MemberExpression", "start":46,"end":53,"loc":{"start":{"line":4,"column":11},"end":{"line":4,"column":18}}, @@ -72,6 +73,7 @@ "type": "ThisExpression", "start":46,"end":50,"loc":{"start":{"line":4,"column":11},"end":{"line":4,"column":15}} }, + "computed": false, "property": { "type": "PrivateName", "start":51,"end":53,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":18}}, @@ -80,8 +82,7 @@ "start":52,"end":53,"loc":{"start":{"line":4,"column":17},"end":{"line":4,"column":18},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } } } ] @@ -104,6 +105,7 @@ "name": "y" } }, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/declared-later-same-class/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/declared-later-same-class/output.json index f610c07abe36..97a237fdb0b4 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/declared-later-same-class/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/declared-later-same-class/output.json @@ -33,6 +33,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "MemberExpression", "start":17,"end":24,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":14}}, @@ -40,6 +41,7 @@ "type": "ThisExpression", "start":17,"end":21,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":11}} }, + "computed": false, "property": { "type": "PrivateName", "start":22,"end":24,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14}}, @@ -48,8 +50,7 @@ "start":23,"end":24,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } } }, { @@ -65,6 +66,7 @@ "name": "y" } }, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-delete-optional-private-property/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-delete-optional-private-property/output.json index a01ec110823f..f210aa21d33b 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-delete-optional-private-property/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-delete-optional-private-property/output.json @@ -36,6 +36,7 @@ "name": "x" } }, + "accessor": false, "value": null }, { diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-delete-private-property/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-delete-private-property/output.json index ed23f9c62a8e..b7f5a89a5e57 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-delete-private-property/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-delete-private-property/output.json @@ -36,6 +36,7 @@ "name": "x" } }, + "accessor": false, "value": null }, { diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-name-constructor/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-name-constructor/output.json index cbc752f26790..abe2b8f001ed 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-name-constructor/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-name-constructor/output.json @@ -36,6 +36,7 @@ "name": "constructor" } }, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/inline/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/inline/output.json index 041c7fcf4f5e..8e7c74b8521f 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/inline/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/inline/output.json @@ -33,6 +33,7 @@ "name": "x" } }, + "accessor": false, "value": null }, { @@ -48,6 +49,7 @@ "name": "y" } }, + "accessor": false, "value": null } ] @@ -79,6 +81,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":36,"end":37,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":16}}, @@ -102,6 +105,7 @@ "name": "y" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":44,"end":45,"loc":{"start":{"line":3,"column":23},"end":{"line":3,"column":24}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/invalid-destructuring-arguments/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/invalid-destructuring-arguments/output.json index 8a1f3e458127..13174beedbba 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/invalid-destructuring-arguments/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/invalid-destructuring-arguments/output.json @@ -36,6 +36,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, @@ -59,6 +60,7 @@ "name": "p" } }, + "accessor": false, "value": { "type": "ArrowFunctionExpression", "start":27,"end":44,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":24}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/invalid-destructuring/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/invalid-destructuring/output.json index 0f46840ba8c7..1085993cf2ff 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/invalid-destructuring/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/invalid-destructuring/output.json @@ -36,6 +36,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/invalid-object-method/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/invalid-object-method/output.json index 7c27ba1380b6..aaaed77e97c9 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/invalid-object-method/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/invalid-object-method/output.json @@ -36,9 +36,14 @@ "name": "p" } }, + "accessor": false, "value": { "type": "ObjectExpression", "start":18,"end":28,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":18}}, + "extra": { + "parenthesized": true, + "parenStart": 17 + }, "properties": [ { "type": "ObjectProperty", @@ -64,11 +69,7 @@ "value": 42 } } - ], - "extra": { - "parenthesized": true, - "parenStart": 17 - } + ] } } ] diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/nested/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/nested/output.json index 6aabfae0aadb..0bc2faf40ee4 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/nested/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/nested/output.json @@ -33,6 +33,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":21,"end":22,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, @@ -56,6 +57,7 @@ "name": "y" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":31,"end":32,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8}}, @@ -136,6 +138,7 @@ "type": "ThisExpression", "start":69,"end":73,"loc":{"start":{"line":6,"column":4},"end":{"line":6,"column":8}} }, + "computed": false, "property": { "type": "PrivateName", "start":74,"end":76,"loc":{"start":{"line":6,"column":9},"end":{"line":6,"column":11}}, @@ -144,8 +147,7 @@ "start":75,"end":76,"loc":{"start":{"line":6,"column":10},"end":{"line":6,"column":11},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } }, "right": { "type": "UnaryExpression", @@ -174,6 +176,7 @@ "type": "ThisExpression", "start":87,"end":91,"loc":{"start":{"line":7,"column":4},"end":{"line":7,"column":8}} }, + "computed": false, "property": { "type": "PrivateName", "start":92,"end":94,"loc":{"start":{"line":7,"column":9},"end":{"line":7,"column":11}}, @@ -182,8 +185,7 @@ "start":93,"end":94,"loc":{"start":{"line":7,"column":10},"end":{"line":7,"column":11},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } }, "right": { "type": "UnaryExpression", @@ -212,12 +214,12 @@ "type": "ThisExpression", "start":106,"end":110,"loc":{"start":{"line":9,"column":4},"end":{"line":9,"column":8}} }, + "computed": false, "property": { "type": "Identifier", "start":111,"end":114,"loc":{"start":{"line":9,"column":9},"end":{"line":9,"column":12},"identifierName":"foo"}, "name": "foo" - }, - "computed": false + } }, "right": { "type": "ClassExpression", @@ -241,6 +243,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":136,"end":137,"loc":{"start":{"line":10,"column":11},"end":{"line":10,"column":12}}, @@ -264,6 +267,7 @@ "name": "y" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":150,"end":151,"loc":{"start":{"line":11,"column":11},"end":{"line":11,"column":12}}, @@ -344,6 +348,7 @@ "type": "ThisExpression", "start":196,"end":200,"loc":{"start":{"line":14,"column":8},"end":{"line":14,"column":12}} }, + "computed": false, "property": { "type": "PrivateName", "start":201,"end":203,"loc":{"start":{"line":14,"column":13},"end":{"line":14,"column":15}}, @@ -352,8 +357,7 @@ "start":202,"end":203,"loc":{"start":{"line":14,"column":14},"end":{"line":14,"column":15},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } }, "right": { "type": "UnaryExpression", @@ -382,6 +386,7 @@ "type": "ThisExpression", "start":218,"end":222,"loc":{"start":{"line":15,"column":8},"end":{"line":15,"column":12}} }, + "computed": false, "property": { "type": "PrivateName", "start":223,"end":225,"loc":{"start":{"line":15,"column":13},"end":{"line":15,"column":15}}, @@ -390,8 +395,7 @@ "start":224,"end":225,"loc":{"start":{"line":15,"column":14},"end":{"line":15,"column":15},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } }, "right": { "type": "UnaryExpression", @@ -439,6 +443,7 @@ "type": "ThisExpression", "start":264,"end":268,"loc":{"start":{"line":18,"column":23},"end":{"line":18,"column":27}} }, + "computed": false, "property": { "type": "PrivateName", "start":269,"end":271,"loc":{"start":{"line":18,"column":28},"end":{"line":18,"column":30}}, @@ -447,8 +452,7 @@ "start":270,"end":271,"loc":{"start":{"line":18,"column":29},"end":{"line":18,"column":30},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } } } ], @@ -494,6 +498,7 @@ "type": "ThisExpression", "start":295,"end":299,"loc":{"start":{"line":19,"column":21},"end":{"line":19,"column":25}} }, + "computed": false, "property": { "type": "PrivateName", "start":300,"end":302,"loc":{"start":{"line":19,"column":26},"end":{"line":19,"column":28}}, @@ -502,8 +507,7 @@ "start":301,"end":302,"loc":{"start":{"line":19,"column":27},"end":{"line":19,"column":28},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } }, "right": { "type": "UnaryExpression", @@ -551,6 +555,7 @@ "type": "ThisExpression", "start":338,"end":342,"loc":{"start":{"line":21,"column":23},"end":{"line":21,"column":27}} }, + "computed": false, "property": { "type": "PrivateName", "start":343,"end":345,"loc":{"start":{"line":21,"column":28},"end":{"line":21,"column":30}}, @@ -559,8 +564,7 @@ "start":344,"end":345,"loc":{"start":{"line":21,"column":29},"end":{"line":21,"column":30},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } } } ], @@ -606,6 +610,7 @@ "type": "ThisExpression", "start":369,"end":373,"loc":{"start":{"line":22,"column":21},"end":{"line":22,"column":25}} }, + "computed": false, "property": { "type": "PrivateName", "start":374,"end":376,"loc":{"start":{"line":22,"column":26},"end":{"line":22,"column":28}}, @@ -614,8 +619,7 @@ "start":375,"end":376,"loc":{"start":{"line":22,"column":27},"end":{"line":22,"column":28},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } }, "right": { "type": "UnaryExpression", @@ -675,6 +679,7 @@ "type": "ThisExpression", "start":414,"end":418,"loc":{"start":{"line":24,"column":25},"end":{"line":24,"column":29}} }, + "computed": false, "property": { "type": "PrivateName", "start":419,"end":421,"loc":{"start":{"line":24,"column":30},"end":{"line":24,"column":32}}, @@ -683,8 +688,7 @@ "start":420,"end":421,"loc":{"start":{"line":24,"column":31},"end":{"line":24,"column":32},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } }, "operator": "===", "right": { @@ -695,6 +699,7 @@ "start":426,"end":427,"loc":{"start":{"line":24,"column":37},"end":{"line":24,"column":38},"identifierName":"p"}, "name": "p" }, + "computed": false, "property": { "type": "PrivateName", "start":428,"end":430,"loc":{"start":{"line":24,"column":39},"end":{"line":24,"column":41}}, @@ -703,8 +708,7 @@ "start":429,"end":430,"loc":{"start":{"line":24,"column":40},"end":{"line":24,"column":41},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } } }, "operator": "&&", @@ -718,6 +722,7 @@ "type": "ThisExpression", "start":434,"end":438,"loc":{"start":{"line":24,"column":45},"end":{"line":24,"column":49}} }, + "computed": false, "property": { "type": "PrivateName", "start":439,"end":441,"loc":{"start":{"line":24,"column":50},"end":{"line":24,"column":52}}, @@ -726,8 +731,7 @@ "start":440,"end":441,"loc":{"start":{"line":24,"column":51},"end":{"line":24,"column":52},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } }, "operator": "===", "right": { @@ -738,6 +742,7 @@ "start":446,"end":447,"loc":{"start":{"line":24,"column":57},"end":{"line":24,"column":58},"identifierName":"p"}, "name": "p" }, + "computed": false, "property": { "type": "PrivateName", "start":448,"end":450,"loc":{"start":{"line":24,"column":59},"end":{"line":24,"column":61}}, @@ -746,8 +751,7 @@ "start":449,"end":450,"loc":{"start":{"line":24,"column":60},"end":{"line":24,"column":61},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } } } } @@ -789,6 +793,7 @@ "type": "ThisExpression", "start":490,"end":494,"loc":{"start":{"line":26,"column":36},"end":{"line":26,"column":40}} }, + "computed": false, "property": { "type": "PrivateName", "start":495,"end":497,"loc":{"start":{"line":26,"column":41},"end":{"line":26,"column":43}}, @@ -797,8 +802,7 @@ "start":496,"end":497,"loc":{"start":{"line":26,"column":42},"end":{"line":26,"column":43},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } }, { "type": "MemberExpression", @@ -807,6 +811,7 @@ "type": "ThisExpression", "start":503,"end":507,"loc":{"start":{"line":26,"column":49},"end":{"line":26,"column":53}} }, + "computed": false, "property": { "type": "PrivateName", "start":508,"end":510,"loc":{"start":{"line":26,"column":54},"end":{"line":26,"column":56}}, @@ -815,8 +820,7 @@ "start":509,"end":510,"loc":{"start":{"line":26,"column":55},"end":{"line":26,"column":56},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } } ], "quasis": [ @@ -892,6 +896,7 @@ "type": "ThisExpression", "start":548,"end":552,"loc":{"start":{"line":30,"column":19},"end":{"line":30,"column":23}} }, + "computed": false, "property": { "type": "PrivateName", "start":553,"end":555,"loc":{"start":{"line":30,"column":24},"end":{"line":30,"column":26}}, @@ -900,8 +905,7 @@ "start":554,"end":555,"loc":{"start":{"line":30,"column":25},"end":{"line":30,"column":26},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } } } ], @@ -947,6 +951,7 @@ "type": "ThisExpression", "start":575,"end":579,"loc":{"start":{"line":31,"column":17},"end":{"line":31,"column":21}} }, + "computed": false, "property": { "type": "PrivateName", "start":580,"end":582,"loc":{"start":{"line":31,"column":22},"end":{"line":31,"column":24}}, @@ -955,8 +960,7 @@ "start":581,"end":582,"loc":{"start":{"line":31,"column":23},"end":{"line":31,"column":24},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } }, "right": { "type": "UnaryExpression", @@ -1004,6 +1008,7 @@ "type": "ThisExpression", "start":614,"end":618,"loc":{"start":{"line":33,"column":19},"end":{"line":33,"column":23}} }, + "computed": false, "property": { "type": "PrivateName", "start":619,"end":621,"loc":{"start":{"line":33,"column":24},"end":{"line":33,"column":26}}, @@ -1012,8 +1017,7 @@ "start":620,"end":621,"loc":{"start":{"line":33,"column":25},"end":{"line":33,"column":26},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } } } ], @@ -1059,6 +1063,7 @@ "type": "ThisExpression", "start":641,"end":645,"loc":{"start":{"line":34,"column":17},"end":{"line":34,"column":21}} }, + "computed": false, "property": { "type": "PrivateName", "start":646,"end":648,"loc":{"start":{"line":34,"column":22},"end":{"line":34,"column":24}}, @@ -1067,8 +1072,7 @@ "start":647,"end":648,"loc":{"start":{"line":34,"column":23},"end":{"line":34,"column":24},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } }, "right": { "type": "UnaryExpression", @@ -1128,6 +1132,7 @@ "type": "ThisExpression", "start":682,"end":686,"loc":{"start":{"line":36,"column":21},"end":{"line":36,"column":25}} }, + "computed": false, "property": { "type": "PrivateName", "start":687,"end":689,"loc":{"start":{"line":36,"column":26},"end":{"line":36,"column":28}}, @@ -1136,8 +1141,7 @@ "start":688,"end":689,"loc":{"start":{"line":36,"column":27},"end":{"line":36,"column":28},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } }, "operator": "===", "right": { @@ -1148,6 +1152,7 @@ "start":694,"end":695,"loc":{"start":{"line":36,"column":33},"end":{"line":36,"column":34},"identifierName":"p"}, "name": "p" }, + "computed": false, "property": { "type": "PrivateName", "start":696,"end":698,"loc":{"start":{"line":36,"column":35},"end":{"line":36,"column":37}}, @@ -1156,8 +1161,7 @@ "start":697,"end":698,"loc":{"start":{"line":36,"column":36},"end":{"line":36,"column":37},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } } }, "operator": "&&", @@ -1171,6 +1175,7 @@ "type": "ThisExpression", "start":702,"end":706,"loc":{"start":{"line":36,"column":41},"end":{"line":36,"column":45}} }, + "computed": false, "property": { "type": "PrivateName", "start":707,"end":709,"loc":{"start":{"line":36,"column":46},"end":{"line":36,"column":48}}, @@ -1179,8 +1184,7 @@ "start":708,"end":709,"loc":{"start":{"line":36,"column":47},"end":{"line":36,"column":48},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } }, "operator": "===", "right": { @@ -1191,6 +1195,7 @@ "start":714,"end":715,"loc":{"start":{"line":36,"column":53},"end":{"line":36,"column":54},"identifierName":"p"}, "name": "p" }, + "computed": false, "property": { "type": "PrivateName", "start":716,"end":718,"loc":{"start":{"line":36,"column":55},"end":{"line":36,"column":57}}, @@ -1199,8 +1204,7 @@ "start":717,"end":718,"loc":{"start":{"line":36,"column":56},"end":{"line":36,"column":57},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } } } } @@ -1242,6 +1246,7 @@ "type": "ThisExpression", "start":754,"end":758,"loc":{"start":{"line":38,"column":32},"end":{"line":38,"column":36}} }, + "computed": false, "property": { "type": "PrivateName", "start":759,"end":761,"loc":{"start":{"line":38,"column":37},"end":{"line":38,"column":39}}, @@ -1250,8 +1255,7 @@ "start":760,"end":761,"loc":{"start":{"line":38,"column":38},"end":{"line":38,"column":39},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } }, { "type": "MemberExpression", @@ -1260,6 +1264,7 @@ "type": "ThisExpression", "start":767,"end":771,"loc":{"start":{"line":38,"column":45},"end":{"line":38,"column":49}} }, + "computed": false, "property": { "type": "PrivateName", "start":772,"end":774,"loc":{"start":{"line":38,"column":50},"end":{"line":38,"column":52}}, @@ -1268,8 +1273,7 @@ "start":773,"end":774,"loc":{"start":{"line":38,"column":51},"end":{"line":38,"column":52},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } } ], "quasis": [ diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-object/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-object/output.json index 2fe350f37ece..e5afccacd51e 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-object/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-object/output.json @@ -33,6 +33,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":26,"end":27,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15}}, @@ -56,6 +57,7 @@ "name": "m" } }, + "accessor": false, "value": { "type": "FunctionExpression", "start":43,"end":56,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":27}}, @@ -150,14 +152,15 @@ "start":124,"end":125,"loc":{"start":{"line":8,"column":6},"end":{"line":8,"column":7},"identifierName":"o"}, "name": "o" }, + "computed": false, "property": { "type": "Identifier", "start":127,"end":130,"loc":{"start":{"line":8,"column":9},"end":{"line":8,"column":12},"identifierName":"Foo"}, "name": "Foo" }, - "computed": false, "optional": true }, + "computed": false, "property": { "type": "PrivateName", "start":131,"end":133,"loc":{"start":{"line":8,"column":13},"end":{"line":8,"column":15}}, @@ -167,7 +170,6 @@ "name": "x" } }, - "computed": false, "optional": false }, { @@ -184,14 +186,15 @@ "start":141,"end":142,"loc":{"start":{"line":9,"column":6},"end":{"line":9,"column":7},"identifierName":"o"}, "name": "o" }, + "computed": false, "property": { "type": "Identifier", "start":144,"end":147,"loc":{"start":{"line":9,"column":9},"end":{"line":9,"column":12},"identifierName":"Foo"}, "name": "Foo" }, - "computed": false, "optional": true }, + "computed": false, "property": { "type": "PrivateName", "start":148,"end":150,"loc":{"start":{"line":9,"column":13},"end":{"line":9,"column":15}}, @@ -201,15 +204,14 @@ "name": "x" } }, - "computed": false, "optional": false }, + "computed": false, "property": { "type": "Identifier", "start":151,"end":158,"loc":{"start":{"line":9,"column":16},"end":{"line":9,"column":23},"identifierName":"toFixed"}, "name": "toFixed" }, - "computed": false, "optional": false }, { @@ -229,14 +231,15 @@ "start":166,"end":167,"loc":{"start":{"line":10,"column":6},"end":{"line":10,"column":7},"identifierName":"o"}, "name": "o" }, + "computed": false, "property": { "type": "Identifier", "start":169,"end":172,"loc":{"start":{"line":10,"column":9},"end":{"line":10,"column":12},"identifierName":"Foo"}, "name": "Foo" }, - "computed": false, "optional": true }, + "computed": false, "property": { "type": "PrivateName", "start":173,"end":175,"loc":{"start":{"line":10,"column":13},"end":{"line":10,"column":15}}, @@ -246,15 +249,14 @@ "name": "x" } }, - "computed": false, "optional": false }, + "computed": false, "property": { "type": "Identifier", "start":176,"end":183,"loc":{"start":{"line":10,"column":16},"end":{"line":10,"column":23},"identifierName":"toFixed"}, "name": "toFixed" }, - "computed": false, "optional": false }, "optional": false, @@ -284,14 +286,15 @@ "start":194,"end":195,"loc":{"start":{"line":11,"column":6},"end":{"line":11,"column":7},"identifierName":"o"}, "name": "o" }, + "computed": false, "property": { "type": "Identifier", "start":197,"end":200,"loc":{"start":{"line":11,"column":9},"end":{"line":11,"column":12},"identifierName":"Foo"}, "name": "Foo" }, - "computed": false, "optional": true }, + "computed": false, "property": { "type": "PrivateName", "start":201,"end":203,"loc":{"start":{"line":11,"column":13},"end":{"line":11,"column":15}}, @@ -301,7 +304,6 @@ "name": "m" } }, - "computed": false, "optional": false }, "optional": false, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-call/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-call/output.json index 4f58452a4825..8c2ad75096bb 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-call/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-call/output.json @@ -33,6 +33,7 @@ "name": "m" } }, + "accessor": false, "value": { "type": "FunctionExpression", "start":26,"end":39,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":27}}, @@ -81,6 +82,7 @@ "start":71,"end":74,"loc":{"start":{"line":5,"column":11},"end":{"line":5,"column":14},"identifierName":"Foo"}, "name": "Foo" }, + "computed": false, "property": { "type": "PrivateName", "start":76,"end":78,"loc":{"start":{"line":5,"column":16},"end":{"line":5,"column":18}}, @@ -90,7 +92,6 @@ "name": "m" } }, - "computed": false, "optional": true }, "optional": false, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-member-call/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-member-call/output.json index 3eff2947cf51..dbafdd05382d 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-member-call/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-member-call/output.json @@ -33,6 +33,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":26,"end":27,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15}}, @@ -79,6 +80,7 @@ "start":59,"end":62,"loc":{"start":{"line":5,"column":11},"end":{"line":5,"column":14},"identifierName":"Foo"}, "name": "Foo" }, + "computed": false, "property": { "type": "PrivateName", "start":64,"end":66,"loc":{"start":{"line":5,"column":16},"end":{"line":5,"column":18}}, @@ -88,15 +90,14 @@ "name": "x" } }, - "computed": false, "optional": true }, + "computed": false, "property": { "type": "Identifier", "start":67,"end":74,"loc":{"start":{"line":5,"column":19},"end":{"line":5,"column":26},"identifierName":"toFixed"}, "name": "toFixed" }, - "computed": false, "optional": false }, "optional": false, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-member/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-member/output.json index 44f1a1d0548a..dcb0a40d03a7 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-member/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-member/output.json @@ -33,6 +33,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":26,"end":27,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15}}, @@ -76,6 +77,7 @@ "start":59,"end":62,"loc":{"start":{"line":5,"column":11},"end":{"line":5,"column":14},"identifierName":"Foo"}, "name": "Foo" }, + "computed": false, "property": { "type": "PrivateName", "start":64,"end":66,"loc":{"start":{"line":5,"column":16},"end":{"line":5,"column":18}}, @@ -85,15 +87,14 @@ "name": "x" } }, - "computed": false, "optional": true }, + "computed": false, "property": { "type": "Identifier", "start":67,"end":74,"loc":{"start":{"line":5,"column":19},"end":{"line":5,"column":26},"identifierName":"toFixed"}, "name": "toFixed" }, - "computed": false, "optional": false } } @@ -107,4 +108,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-simple/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-simple/output.json index bf77ed55e9a7..92fad1df8a6f 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-simple/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-simple/output.json @@ -33,6 +33,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":26,"end":27,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15}}, @@ -73,6 +74,7 @@ "start":59,"end":62,"loc":{"start":{"line":5,"column":11},"end":{"line":5,"column":14},"identifierName":"Foo"}, "name": "Foo" }, + "computed": false, "property": { "type": "PrivateName", "start":64,"end":66,"loc":{"start":{"line":5,"column":16},"end":{"line":5,"column":18}}, @@ -82,7 +84,6 @@ "name": "x" } }, - "computed": false, "optional": true } } diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/pbn-success/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/pbn-success/output.json index 31ce19c94ef4..a57764a81392 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/pbn-success/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/pbn-success/output.json @@ -33,6 +33,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":21,"end":22,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, @@ -56,6 +57,7 @@ "name": "y" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":31,"end":32,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8}}, @@ -136,6 +138,7 @@ "type": "ThisExpression", "start":69,"end":73,"loc":{"start":{"line":6,"column":4},"end":{"line":6,"column":8}} }, + "computed": false, "property": { "type": "PrivateName", "start":74,"end":76,"loc":{"start":{"line":6,"column":9},"end":{"line":6,"column":11}}, @@ -144,8 +147,7 @@ "start":75,"end":76,"loc":{"start":{"line":6,"column":10},"end":{"line":6,"column":11},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } }, "right": { "type": "UnaryExpression", @@ -174,6 +176,7 @@ "type": "ThisExpression", "start":87,"end":91,"loc":{"start":{"line":7,"column":4},"end":{"line":7,"column":8}} }, + "computed": false, "property": { "type": "PrivateName", "start":92,"end":94,"loc":{"start":{"line":7,"column":9},"end":{"line":7,"column":11}}, @@ -182,8 +185,7 @@ "start":93,"end":94,"loc":{"start":{"line":7,"column":10},"end":{"line":7,"column":11},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } }, "right": { "type": "UnaryExpression", @@ -231,6 +233,7 @@ "type": "ThisExpression", "start":125,"end":129,"loc":{"start":{"line":10,"column":19},"end":{"line":10,"column":23}} }, + "computed": false, "property": { "type": "PrivateName", "start":130,"end":132,"loc":{"start":{"line":10,"column":24},"end":{"line":10,"column":26}}, @@ -239,8 +242,7 @@ "start":131,"end":132,"loc":{"start":{"line":10,"column":25},"end":{"line":10,"column":26},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } } } ], @@ -286,6 +288,7 @@ "type": "ThisExpression", "start":152,"end":156,"loc":{"start":{"line":11,"column":17},"end":{"line":11,"column":21}} }, + "computed": false, "property": { "type": "PrivateName", "start":157,"end":159,"loc":{"start":{"line":11,"column":22},"end":{"line":11,"column":24}}, @@ -294,8 +297,7 @@ "start":158,"end":159,"loc":{"start":{"line":11,"column":23},"end":{"line":11,"column":24},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } }, "right": { "type": "UnaryExpression", @@ -343,6 +345,7 @@ "type": "ThisExpression", "start":191,"end":195,"loc":{"start":{"line":13,"column":19},"end":{"line":13,"column":23}} }, + "computed": false, "property": { "type": "PrivateName", "start":196,"end":198,"loc":{"start":{"line":13,"column":24},"end":{"line":13,"column":26}}, @@ -351,8 +354,7 @@ "start":197,"end":198,"loc":{"start":{"line":13,"column":25},"end":{"line":13,"column":26},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } } } ], @@ -398,6 +400,7 @@ "type": "ThisExpression", "start":218,"end":222,"loc":{"start":{"line":14,"column":17},"end":{"line":14,"column":21}} }, + "computed": false, "property": { "type": "PrivateName", "start":223,"end":225,"loc":{"start":{"line":14,"column":22},"end":{"line":14,"column":24}}, @@ -406,8 +409,7 @@ "start":224,"end":225,"loc":{"start":{"line":14,"column":23},"end":{"line":14,"column":24},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } }, "right": { "type": "UnaryExpression", @@ -467,6 +469,7 @@ "type": "ThisExpression", "start":259,"end":263,"loc":{"start":{"line":16,"column":21},"end":{"line":16,"column":25}} }, + "computed": false, "property": { "type": "PrivateName", "start":264,"end":266,"loc":{"start":{"line":16,"column":26},"end":{"line":16,"column":28}}, @@ -475,8 +478,7 @@ "start":265,"end":266,"loc":{"start":{"line":16,"column":27},"end":{"line":16,"column":28},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } }, "operator": "===", "right": { @@ -487,6 +489,7 @@ "start":271,"end":272,"loc":{"start":{"line":16,"column":33},"end":{"line":16,"column":34},"identifierName":"p"}, "name": "p" }, + "computed": false, "property": { "type": "PrivateName", "start":273,"end":275,"loc":{"start":{"line":16,"column":35},"end":{"line":16,"column":37}}, @@ -495,8 +498,7 @@ "start":274,"end":275,"loc":{"start":{"line":16,"column":36},"end":{"line":16,"column":37},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } } }, "operator": "&&", @@ -510,6 +512,7 @@ "type": "ThisExpression", "start":279,"end":283,"loc":{"start":{"line":16,"column":41},"end":{"line":16,"column":45}} }, + "computed": false, "property": { "type": "PrivateName", "start":284,"end":286,"loc":{"start":{"line":16,"column":46},"end":{"line":16,"column":48}}, @@ -518,8 +521,7 @@ "start":285,"end":286,"loc":{"start":{"line":16,"column":47},"end":{"line":16,"column":48},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } }, "operator": "===", "right": { @@ -530,6 +532,7 @@ "start":291,"end":292,"loc":{"start":{"line":16,"column":53},"end":{"line":16,"column":54},"identifierName":"p"}, "name": "p" }, + "computed": false, "property": { "type": "PrivateName", "start":293,"end":295,"loc":{"start":{"line":16,"column":55},"end":{"line":16,"column":57}}, @@ -538,8 +541,7 @@ "start":294,"end":295,"loc":{"start":{"line":16,"column":56},"end":{"line":16,"column":57},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } } } } @@ -581,6 +583,7 @@ "type": "ThisExpression", "start":331,"end":335,"loc":{"start":{"line":18,"column":32},"end":{"line":18,"column":36}} }, + "computed": false, "property": { "type": "PrivateName", "start":336,"end":338,"loc":{"start":{"line":18,"column":37},"end":{"line":18,"column":39}}, @@ -589,8 +592,7 @@ "start":337,"end":338,"loc":{"start":{"line":18,"column":38},"end":{"line":18,"column":39},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } }, { "type": "MemberExpression", @@ -599,6 +601,7 @@ "type": "ThisExpression", "start":344,"end":348,"loc":{"start":{"line":18,"column":45},"end":{"line":18,"column":49}} }, + "computed": false, "property": { "type": "PrivateName", "start":349,"end":351,"loc":{"start":{"line":18,"column":50},"end":{"line":18,"column":52}}, @@ -607,8 +610,7 @@ "start":350,"end":351,"loc":{"start":{"line":18,"column":51},"end":{"line":18,"column":52},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } } ], "quasis": [ diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/static/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/static/output.json index 824195dc1993..d561ee9bcdfe 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/static/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/static/output.json @@ -33,6 +33,7 @@ "name": "x" } }, + "accessor": false, "value": null }, { @@ -48,6 +49,7 @@ "name": "y" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":37,"end":38,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/super-call/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/super-call/output.json index f487856e8e9b..9d35a82fe388 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/super-call/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/super-call/output.json @@ -76,6 +76,7 @@ "name": "foo" } }, + "accessor": false, "value": { "type": "CallExpression", "start":75,"end":82,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":20}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/super-private-member-access/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/super-private-member-access/output.json index c501bd6487fb..89109dfbd76a 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/super-private-member-access/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/super-private-member-access/output.json @@ -40,6 +40,7 @@ "name": "x" } }, + "accessor": false, "value": null }, { diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/undeclared-nested/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/undeclared-nested/output.json index 95734dd97d67..f2e79c385d54 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/undeclared-nested/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/undeclared-nested/output.json @@ -36,6 +36,7 @@ "name": "x" } }, + "accessor": false, "value": null }, { diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-arrow-function/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-arrow-function/output.json index 9e1f3d4cb957..35482aade8db 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-arrow-function/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-arrow-function/output.json @@ -48,6 +48,7 @@ "name": "foo" }, "computed": false, + "accessor": false, "value": { "type": "ArrowFunctionExpression", "start":38,"end":53,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":25}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-function/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-function/output.json index 80d1655ddfd8..e0818cbf3877 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-function/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-function/output.json @@ -45,6 +45,7 @@ "name": "foo" }, "computed": false, + "accessor": false, "value": { "type": "FunctionExpression", "start":38,"end":64,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":36}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-key/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-key/output.json index a1c8be9580e2..a1dde5633e33 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-key/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-key/output.json @@ -45,6 +45,7 @@ "start":33,"end":42,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":14},"identifierName":"arguments"}, "name": "arguments" }, + "accessor": false, "value": { "type": "NumericLiteral", "start":46,"end":47,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":19}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-nested-class-decorator-call-expression/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-nested-class-decorator-call-expression/output.json index 9cf33d0715eb..aca9bf845231 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-nested-class-decorator-call-expression/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-nested-class-decorator-call-expression/output.json @@ -48,6 +48,7 @@ "name": "foo" }, "computed": false, + "accessor": false, "value": { "type": "ClassExpression", "start":38,"end":69,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":41}}, @@ -93,6 +94,7 @@ "name": "foo" }, "computed": false, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-nested-class/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-nested-class/output.json index c119e2e0c73c..ed9848fc4b44 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-nested-class/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-nested-class/output.json @@ -45,6 +45,7 @@ "name": "foo" }, "computed": false, + "accessor": false, "value": { "type": "ClassExpression", "start":38,"end":69,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":41}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/arguments/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/arguments/output.json index 1b13199f02be..bedd245ca0e4 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-properties/arguments/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/arguments/output.json @@ -48,6 +48,7 @@ "name": "foo" }, "computed": false, + "accessor": false, "value": { "type": "Identifier", "start":38,"end":47,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":19},"identifierName":"arguments"}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/asi-success/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/asi-success/output.json index 0491fc9e8991..76bc5eb557f7 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-properties/asi-success/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/asi-success/output.json @@ -42,6 +42,7 @@ "name": "y" }, "computed": false, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/await-identifier-in-computed-property-in-arguments-of-async-call/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/await-identifier-in-computed-property-in-arguments-of-async-call/output.json index f8e1e588c420..bd85608cc811 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-properties/await-identifier-in-computed-property-in-arguments-of-async-call/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/await-identifier-in-computed-property-in-arguments-of-async-call/output.json @@ -47,6 +47,7 @@ "start":20,"end":25,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":25},"identifierName":"await"}, "name": "await" }, + "accessor": false, "value": { "type": "Identifier", "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30},"identifierName":"x"}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/await-identifier-in-computed-property-inside-params-of-function-inside-params-of-async-function/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/await-identifier-in-computed-property-inside-params-of-function-inside-params-of-async-function/output.json index a6f14fe50023..d6dd3e695c79 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-properties/await-identifier-in-computed-property-inside-params-of-function-inside-params-of-async-function/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/await-identifier-in-computed-property-inside-params-of-function-inside-params-of-async-function/output.json @@ -63,6 +63,7 @@ "start":35,"end":40,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":40},"identifierName":"await"}, "name": "await" }, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/await-identifier-in-property-in-arguments-of-async-call/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/await-identifier-in-property-in-arguments-of-async-call/output.json index b044a5fd6ad1..44072a80b038 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-properties/await-identifier-in-property-in-arguments-of-async-call/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/await-identifier-in-property-in-arguments-of-async-call/output.json @@ -47,6 +47,7 @@ "name": "x" }, "computed": false, + "accessor": false, "value": { "type": "Identifier", "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28},"identifierName":"await"}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/await-in-async-in-class-property/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/await-in-async-in-class-property/output.json index b065c96cb131..27b0f51d2157 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-properties/await-in-async-in-class-property/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/await-in-async-in-class-property/output.json @@ -30,6 +30,7 @@ "name": "p" }, "computed": false, + "accessor": false, "value": { "type": "ArrowFunctionExpression", "start":16,"end":38,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":28}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/await-in-class-property-in-async/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/await-in-class-property-in-async/output.json index c58d4a6533da..ec1485c4c429 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-properties/await-in-class-property-in-async/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/await-in-class-property-in-async/output.json @@ -37,6 +37,13 @@ { "type": "ClassProperty", "start":75,"end":90,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":19}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": " here await is an identifier reference", + "start":30,"end":70,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":44}} + } + ], "static": false, "key": { "type": "Identifier", @@ -44,6 +51,7 @@ "name": "p" }, "computed": false, + "accessor": false, "value": { "type": "BinaryExpression", "start":79,"end":89,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":18}}, @@ -62,14 +70,7 @@ }, "value": 42 } - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " here await is an identifier reference", - "start":30,"end":70,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":44}} - } - ] + } } ] } diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/await-in-computed-property-in-params-of-async-arrow/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/await-in-computed-property-in-params-of-async-arrow/output.json index 9cb65937fe60..c9da07e8c5d0 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-properties/await-in-computed-property-in-params-of-async-arrow/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/await-in-computed-property-in-params-of-async-arrow/output.json @@ -47,6 +47,7 @@ "start":20,"end":25,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":25},"identifierName":"await"}, "name": "await" }, + "accessor": false, "value": { "type": "Identifier", "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30},"identifierName":"x"}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/await-in-property-in-params-of-async-arrow/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/await-in-property-in-params-of-async-arrow/output.json index 476f99420b75..f41be11bedbf 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-properties/await-in-property-in-params-of-async-arrow/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/await-in-property-in-params-of-async-arrow/output.json @@ -44,6 +44,7 @@ "name": "x" }, "computed": false, + "accessor": false, "value": { "type": "Identifier", "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28},"identifierName":"await"}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/computed/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/computed/output.json index 9dcd00dceb49..a4e66637e901 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-properties/computed/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/computed/output.json @@ -46,6 +46,7 @@ }, "value": "y" }, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/edge-cases/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/edge-cases/output.json index b73acc4a8d3f..643fb54a1e8c 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-properties/edge-cases/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/edge-cases/output.json @@ -42,6 +42,7 @@ "name": "static" }, "static": false, + "accessor": false, "value": null } ] @@ -70,6 +71,7 @@ "name": "a" }, "computed": false, + "accessor": false, "value": null } ] @@ -98,6 +100,7 @@ "name": "get" }, "computed": false, + "accessor": false, "value": null } ] @@ -126,6 +129,7 @@ "name": "set" }, "computed": false, + "accessor": false, "value": null } ] @@ -154,6 +158,7 @@ "name": "static" }, "static": false, + "accessor": false, "value": null } ] @@ -182,6 +187,7 @@ "name": "async" }, "computed": false, + "accessor": false, "value": null } ] @@ -360,6 +366,7 @@ "name": "a" }, "computed": false, + "accessor": false, "value": null } ] @@ -388,6 +395,7 @@ "name": "static" }, "static": false, + "accessor": false, "value": null } ] @@ -416,6 +424,7 @@ "name": "static" }, "static": false, + "accessor": false, "value": { "type": "NumericLiteral", "start":298,"end":299,"loc":{"start":{"line":37,"column":11},"end":{"line":37,"column":12}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/inline/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/inline/output.json index 80cff7767730..5a801f9a39cb 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-properties/inline/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/inline/output.json @@ -30,6 +30,7 @@ "name": "x" }, "computed": false, + "accessor": false, "value": null }, { @@ -42,6 +43,7 @@ "name": "y" }, "computed": false, + "accessor": false, "value": null } ] @@ -70,6 +72,7 @@ "name": "x" }, "computed": false, + "accessor": false, "value": { "type": "NumericLiteral", "start":33,"end":34,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15}}, @@ -90,6 +93,7 @@ "name": "y" }, "computed": false, + "accessor": false, "value": { "type": "NumericLiteral", "start":40,"end":41,"loc":{"start":{"line":3,"column":21},"end":{"line":3,"column":22}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/new-target-with-flow/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/new-target-with-flow/output.json index 1bce1392d067..28d0577b6b1c 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-properties/new-target-with-flow/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/new-target-with-flow/output.json @@ -31,6 +31,7 @@ }, "computed": false, "variance": null, + "accessor": false, "value": { "type": "MetaProperty", "start":23,"end":33,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":23}}, @@ -57,9 +58,14 @@ }, "computed": false, "variance": null, + "accessor": false, "value": { "type": "AssignmentExpression", "start":49,"end":74,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":39}}, + "extra": { + "parenthesized": true, + "parenStart": 48 + }, "operator": "=", "left": { "type": "Identifier", @@ -104,10 +110,6 @@ } ] } - }, - "extra": { - "parenthesized": true, - "parenStart": 48 } } }, @@ -122,6 +124,7 @@ }, "computed": false, "variance": null, + "accessor": false, "value": { "type": "ArrowFunctionExpression", "start":90,"end":106,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":29}}, @@ -156,6 +159,7 @@ }, "computed": false, "variance": null, + "accessor": false, "value": { "type": "ArrowFunctionExpression", "start":121,"end":145,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":37}}, @@ -206,6 +210,7 @@ }, "computed": false, "variance": null, + "accessor": false, "value": { "type": "MetaProperty", "start":153,"end":163,"loc":{"start":{"line":6,"column":6},"end":{"line":6,"column":16}}, @@ -232,9 +237,14 @@ }, "computed": false, "variance": null, + "accessor": false, "value": { "type": "AssignmentExpression", "start":172,"end":197,"loc":{"start":{"line":7,"column":7},"end":{"line":7,"column":32}}, + "extra": { + "parenthesized": true, + "parenStart": 171 + }, "operator": "=", "left": { "type": "Identifier", @@ -279,10 +289,6 @@ } ] } - }, - "extra": { - "parenthesized": true, - "parenStart": 171 } } }, @@ -297,6 +303,7 @@ }, "computed": false, "variance": null, + "accessor": false, "value": { "type": "ArrowFunctionExpression", "start":206,"end":222,"loc":{"start":{"line":8,"column":6},"end":{"line":8,"column":22}}, @@ -331,6 +338,7 @@ }, "computed": false, "variance": null, + "accessor": false, "value": { "type": "ArrowFunctionExpression", "start":230,"end":254,"loc":{"start":{"line":9,"column":6},"end":{"line":9,"column":30}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/new-target/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/new-target/output.json index 5f0cc9d12fbb..8d10aea74913 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-properties/new-target/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/new-target/output.json @@ -30,6 +30,7 @@ "name": "a" }, "computed": false, + "accessor": false, "value": { "type": "MetaProperty", "start":23,"end":33,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":23}}, @@ -55,9 +56,14 @@ "name": "b" }, "computed": false, + "accessor": false, "value": { "type": "AssignmentExpression", "start":49,"end":74,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":39}}, + "extra": { + "parenthesized": true, + "parenStart": 48 + }, "operator": "=", "left": { "type": "Identifier", @@ -102,10 +108,6 @@ } ] } - }, - "extra": { - "parenthesized": true, - "parenStart": 48 } } }, @@ -119,6 +121,7 @@ "name": "c" }, "computed": false, + "accessor": false, "value": { "type": "ArrowFunctionExpression", "start":90,"end":106,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":29}}, @@ -152,6 +155,7 @@ "name": "d" }, "computed": false, + "accessor": false, "value": { "type": "ArrowFunctionExpression", "start":121,"end":145,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":37}}, @@ -201,6 +205,7 @@ "name": "e" }, "computed": false, + "accessor": false, "value": { "type": "MetaProperty", "start":153,"end":163,"loc":{"start":{"line":6,"column":6},"end":{"line":6,"column":16}}, @@ -226,9 +231,14 @@ "name": "f" }, "computed": false, + "accessor": false, "value": { "type": "AssignmentExpression", "start":172,"end":197,"loc":{"start":{"line":7,"column":7},"end":{"line":7,"column":32}}, + "extra": { + "parenthesized": true, + "parenStart": 171 + }, "operator": "=", "left": { "type": "Identifier", @@ -273,10 +283,6 @@ } ] } - }, - "extra": { - "parenthesized": true, - "parenStart": 171 } } }, @@ -290,6 +296,7 @@ "name": "g" }, "computed": false, + "accessor": false, "value": { "type": "ArrowFunctionExpression", "start":206,"end":222,"loc":{"start":{"line":8,"column":6},"end":{"line":8,"column":22}}, @@ -323,6 +330,7 @@ "name": "h" }, "computed": false, + "accessor": false, "value": { "type": "ArrowFunctionExpression", "start":230,"end":254,"loc":{"start":{"line":9,"column":6},"end":{"line":9,"column":30}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/no-ctor/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/no-ctor/output.json index 97fea08fdeb9..634fced9313d 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-properties/no-ctor/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/no-ctor/output.json @@ -33,6 +33,7 @@ "name": "constructor" }, "computed": false, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/no-static-prototype/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/no-static-prototype/output.json index 7dc42678844a..4f8e02c39130 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-properties/no-static-prototype/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/no-static-prototype/output.json @@ -33,6 +33,7 @@ "name": "prototype" }, "computed": false, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/static-field-named-constructor/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/static-field-named-constructor/output.json index ac7c55167733..de512b36aea6 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-properties/static-field-named-constructor/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/static-field-named-constructor/output.json @@ -33,6 +33,7 @@ "name": "constructor" }, "computed": false, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/super-call/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/super-call/output.json index 06b7a38120c7..c42877bdce3b 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-properties/super-call/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/super-call/output.json @@ -73,6 +73,7 @@ "name": "foo" }, "computed": false, + "accessor": false, "value": { "type": "CallExpression", "start":74,"end":81,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":19}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/super-inside-arrow-function/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/super-inside-arrow-function/output.json index 7b6feb810065..ab8ba4bb1dc5 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-properties/super-inside-arrow-function/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/super-inside-arrow-function/output.json @@ -34,6 +34,7 @@ "name": "foo" }, "computed": false, + "accessor": false, "value": { "type": "ArrowFunctionExpression", "start":28,"end":43,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":23}}, @@ -51,12 +52,12 @@ "type": "Super", "start":34,"end":39,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":19}} }, + "computed": false, "property": { "type": "Identifier", "start":40,"end":41,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":21},"identifierName":"x"}, "name": "x" - }, - "computed": false + } }, "arguments": [] } diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/super-inside-function/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/super-inside-function/output.json index 6b7dea14cff7..35759761a7d3 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-properties/super-inside-function/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/super-inside-function/output.json @@ -33,6 +33,7 @@ "name": "foo" }, "computed": false, + "accessor": false, "value": { "type": "FunctionExpression", "start":18,"end":52,"loc":{"start":{"line":2,"column":8},"end":{"line":4,"column":3}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/super/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/super/output.json index 6952e399c10a..a433f49937f3 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-properties/super/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/super/output.json @@ -63,6 +63,7 @@ "name": "c" }, "computed": false, + "accessor": false, "value": { "type": "CallExpression", "start":44,"end":53,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":15}}, @@ -73,12 +74,12 @@ "type": "Super", "start":44,"end":49,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":11}} }, + "computed": false, "property": { "type": "Identifier", "start":50,"end":51,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13},"identifierName":"c"}, "name": "c" - }, - "computed": false + } }, "arguments": [] } diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/yield-in-class-property-in-generator/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/yield-in-class-property-in-generator/output.json index 2e1ffaf6cded..6d95cb9a50ab 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-properties/yield-in-class-property-in-generator/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/yield-in-class-property-in-generator/output.json @@ -55,6 +55,7 @@ "name": "p" }, "computed": false, + "accessor": false, "value": { "type": "BinaryExpression", "start":83,"end":93,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":18}}, diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/yield-in-generator-in-class-property/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/yield-in-generator-in-class-property/output.json index 004925a92410..2ca3af15743f 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-properties/yield-in-generator-in-class-property/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/yield-in-generator-in-class-property/output.json @@ -30,6 +30,7 @@ "name": "p" }, "computed": false, + "accessor": false, "value": { "type": "FunctionExpression", "start":16,"end":43,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":33}}, diff --git a/packages/babel-parser/test/fixtures/estree/class-private-property/basic/output.json b/packages/babel-parser/test/fixtures/estree/class-private-property/basic/output.json index 23c1a61c1202..310464a80de1 100644 --- a/packages/babel-parser/test/fixtures/estree/class-private-property/basic/output.json +++ b/packages/babel-parser/test/fixtures/estree/class-private-property/basic/output.json @@ -29,6 +29,7 @@ "start":12,"end":16,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":6}}, "name": "foo" }, + "accessor": false, "value": { "type": "Literal", "start":19,"end":24,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":14}}, @@ -46,6 +47,7 @@ "start":35,"end":39,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":13}}, "name": "bar" }, + "accessor": false, "value": { "type": "Identifier", "start":42,"end":45,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":19},"identifierName":"foo"}, diff --git a/packages/babel-parser/test/fixtures/estree/class-private-property/flow/output.json b/packages/babel-parser/test/fixtures/estree/class-private-property/flow/output.json index e8de51b0d2a1..c45ddf8dd734 100644 --- a/packages/babel-parser/test/fixtures/estree/class-private-property/flow/output.json +++ b/packages/babel-parser/test/fixtures/estree/class-private-property/flow/output.json @@ -30,6 +30,7 @@ "name": "foo" }, "variance": null, + "accessor": false, "value": { "type": "Literal", "start":19,"end":24,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":14}}, @@ -48,6 +49,7 @@ "name": "bar" }, "variance": null, + "accessor": false, "value": { "type": "Identifier", "start":42,"end":45,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":19},"identifierName":"foo"}, @@ -66,6 +68,7 @@ "name": "qux" }, "variance": null, + "accessor": false, "typeAnnotation": { "type": "TypeAnnotation", "start":61,"end":76,"loc":{"start":{"line":4,"column":14},"end":{"line":4,"column":29}}, diff --git a/packages/babel-parser/test/fixtures/estree/class-private-property/not-enabled/output.json b/packages/babel-parser/test/fixtures/estree/class-private-property/not-enabled/output.json index 23c1a61c1202..310464a80de1 100644 --- a/packages/babel-parser/test/fixtures/estree/class-private-property/not-enabled/output.json +++ b/packages/babel-parser/test/fixtures/estree/class-private-property/not-enabled/output.json @@ -29,6 +29,7 @@ "start":12,"end":16,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":6}}, "name": "foo" }, + "accessor": false, "value": { "type": "Literal", "start":19,"end":24,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":14}}, @@ -46,6 +47,7 @@ "start":35,"end":39,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":13}}, "name": "bar" }, + "accessor": false, "value": { "type": "Identifier", "start":42,"end":45,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":19},"identifierName":"foo"}, diff --git a/packages/babel-parser/test/fixtures/estree/class-private-property/typescript/output.json b/packages/babel-parser/test/fixtures/estree/class-private-property/typescript/output.json index 5fc9b9306afd..3cb2aa7d1573 100644 --- a/packages/babel-parser/test/fixtures/estree/class-private-property/typescript/output.json +++ b/packages/babel-parser/test/fixtures/estree/class-private-property/typescript/output.json @@ -29,6 +29,7 @@ "start":12,"end":16,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":6}}, "name": "foo" }, + "accessor": false, "value": { "type": "Literal", "start":19,"end":24,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":14}}, @@ -46,6 +47,7 @@ "start":35,"end":39,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":13}}, "name": "bar" }, + "accessor": false, "value": { "type": "Identifier", "start":42,"end":45,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":19},"identifierName":"foo"}, @@ -63,6 +65,7 @@ "start":57,"end":61,"loc":{"start":{"line":4,"column":10},"end":{"line":4,"column":14}}, "name": "qux" }, + "accessor": false, "typeAnnotation": { "type": "TSTypeAnnotation", "start":61,"end":76,"loc":{"start":{"line":4,"column":14},"end":{"line":4,"column":29}}, diff --git a/packages/babel-parser/test/fixtures/estree/class-property/basic/output.json b/packages/babel-parser/test/fixtures/estree/class-property/basic/output.json index 2147f4df6df8..fdd9ab939df1 100644 --- a/packages/babel-parser/test/fixtures/estree/class-property/basic/output.json +++ b/packages/babel-parser/test/fixtures/estree/class-property/basic/output.json @@ -30,6 +30,7 @@ "name": "foo" }, "computed": false, + "accessor": false, "value": { "type": "Literal", "start":18,"end":23,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":13}}, @@ -47,6 +48,7 @@ "start":28,"end":31,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":6},"identifierName":"bar"}, "name": "bar" }, + "accessor": false, "value": { "type": "Identifier", "start":35,"end":38,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":13},"identifierName":"foo"}, @@ -64,6 +66,7 @@ "raw": "\"qux\"" }, "computed": false, + "accessor": false, "value": { "type": "Literal", "start":57,"end":63,"loc":{"start":{"line":4,"column":17},"end":{"line":4,"column":23}}, @@ -81,6 +84,7 @@ "start":75,"end":79,"loc":{"start":{"line":5,"column":10},"end":{"line":5,"column":14},"identifierName":"quux"}, "name": "quux" }, + "accessor": false, "value": { "type": "Literal", "start":83,"end":88,"loc":{"start":{"line":5,"column":18},"end":{"line":5,"column":23}}, diff --git a/packages/babel-parser/test/fixtures/estree/class-property/not-enabled/output.json b/packages/babel-parser/test/fixtures/estree/class-property/not-enabled/output.json index 9af1141579ba..225b67211bba 100644 --- a/packages/babel-parser/test/fixtures/estree/class-property/not-enabled/output.json +++ b/packages/babel-parser/test/fixtures/estree/class-property/not-enabled/output.json @@ -30,6 +30,7 @@ "name": "foo" }, "computed": false, + "accessor": false, "value": { "type": "Literal", "start":18,"end":23,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":13}}, @@ -47,6 +48,7 @@ "start":28,"end":31,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":6},"identifierName":"bar"}, "name": "bar" }, + "accessor": false, "value": { "type": "Identifier", "start":35,"end":38,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":13},"identifierName":"foo"}, @@ -64,6 +66,7 @@ "raw": "\"qux\"" }, "computed": false, + "accessor": false, "value": { "type": "Literal", "start":57,"end":63,"loc":{"start":{"line":4,"column":17},"end":{"line":4,"column":23}}, @@ -81,6 +84,7 @@ "start":75,"end":79,"loc":{"start":{"line":5,"column":10},"end":{"line":5,"column":14},"identifierName":"quux"}, "name": "quux" }, + "accessor": false, "value": { "type": "Literal", "start":83,"end":88,"loc":{"start":{"line":5,"column":18},"end":{"line":5,"column":23}}, diff --git a/packages/babel-parser/test/fixtures/estree/private-in/basic/output.json b/packages/babel-parser/test/fixtures/estree/private-in/basic/output.json index 666b0fc1e83d..91b43ef2b798 100644 --- a/packages/babel-parser/test/fixtures/estree/private-in/basic/output.json +++ b/packages/babel-parser/test/fixtures/estree/private-in/basic/output.json @@ -33,6 +33,7 @@ "name": "foo" } }, + "accessor": false, "value": { "type": "Literal", "start":19,"end":24,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":14}}, diff --git a/packages/babel-parser/test/fixtures/experimental/accessor/basic-accessor/input.js b/packages/babel-parser/test/fixtures/experimental/accessor/basic-accessor/input.js new file mode 100644 index 000000000000..735a7a78e304 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/accessor/basic-accessor/input.js @@ -0,0 +1,3 @@ +class Foo { + accessor bar; +} diff --git a/packages/babel-parser/test/fixtures/experimental/accessor/basic-accessor/output.json b/packages/babel-parser/test/fixtures/experimental/accessor/basic-accessor/output.json new file mode 100644 index 000000000000..f4b57591a939 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/accessor/basic-accessor/output.json @@ -0,0 +1,42 @@ +{ + "type": "File", + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, + "program": { + "type": "Program", + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, + "id": { + "type": "Identifier", + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9},"identifierName":"Foo"}, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start":10,"end":29,"loc":{"start":{"line":1,"column":10},"end":{"line":3,"column":1}}, + "body": [ + { + "type": "ClassProperty", + "start":14,"end":27,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":15}}, + "static": false, + "key": { + "type": "Identifier", + "start":23,"end":26,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":14},"identifierName":"bar"}, + "name": "bar" + }, + "computed": false, + "accessor": true, + "value": null + } + ] + } + } + ], + "directives": [] + } +} diff --git a/packages/babel-parser/test/fixtures/experimental/accessor/field-named-accessor/input.js b/packages/babel-parser/test/fixtures/experimental/accessor/field-named-accessor/input.js new file mode 100644 index 000000000000..fba4a91f8875 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/accessor/field-named-accessor/input.js @@ -0,0 +1,3 @@ +class Foo { + accessor = 123; +} diff --git a/packages/babel-parser/test/fixtures/experimental/accessor/field-named-accessor/output.json b/packages/babel-parser/test/fixtures/experimental/accessor/field-named-accessor/output.json new file mode 100644 index 000000000000..9f9598f566fb --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/accessor/field-named-accessor/output.json @@ -0,0 +1,50 @@ +{ + "type": "File", + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, + "program": { + "type": "Program", + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, + "id": { + "type": "Identifier", + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9},"identifierName":"Foo"}, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start":10,"end":31,"loc":{"start":{"line":1,"column":10},"end":{"line":3,"column":1}}, + "body": [ + { + "type": "ClassProperty", + "start":14,"end":29,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":17}}, + "static": false, + "key": { + "type": "Identifier", + "start":14,"end":22,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":10},"identifierName":"accessor"}, + "name": "accessor" + }, + "computed": false, + "accessor": false, + "value": { + "type": "NumericLiteral", + "start":25,"end":28,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":16}}, + "extra": { + "rawValue": 123, + "raw": "123" + }, + "value": 123 + } + } + ] + } + } + ], + "directives": [] + } +} diff --git a/packages/babel-parser/test/fixtures/experimental/accessor/method-named-accessor/input.js b/packages/babel-parser/test/fixtures/experimental/accessor/method-named-accessor/input.js new file mode 100644 index 000000000000..d4092463f89a --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/accessor/method-named-accessor/input.js @@ -0,0 +1,3 @@ +class Foo { + accessor() {} +} diff --git a/packages/babel-parser/test/fixtures/experimental/accessor/method-named-accessor/output.json b/packages/babel-parser/test/fixtures/experimental/accessor/method-named-accessor/output.json new file mode 100644 index 000000000000..b55c19130b12 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/accessor/method-named-accessor/output.json @@ -0,0 +1,51 @@ +{ + "type": "File", + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, + "program": { + "type": "Program", + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, + "id": { + "type": "Identifier", + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9},"identifierName":"Foo"}, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start":10,"end":29,"loc":{"start":{"line":1,"column":10},"end":{"line":3,"column":1}}, + "body": [ + { + "type": "ClassMethod", + "start":14,"end":27,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":15}}, + "static": false, + "key": { + "type": "Identifier", + "start":14,"end":22,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":10},"identifierName":"accessor"}, + "name": "accessor" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start":25,"end":27,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":15}}, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} diff --git a/packages/babel-parser/test/fixtures/experimental/accessor/not-allowed-on-methods/input.js b/packages/babel-parser/test/fixtures/experimental/accessor/not-allowed-on-methods/input.js new file mode 100644 index 000000000000..4e41f3511da0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/accessor/not-allowed-on-methods/input.js @@ -0,0 +1,5 @@ +class Foo { + accessor bar() { + + } +} diff --git a/packages/babel-parser/test/fixtures/experimental/accessor/not-allowed-on-methods/options.json b/packages/babel-parser/test/fixtures/experimental/accessor/not-allowed-on-methods/options.json new file mode 100644 index 000000000000..a1c98245e1ed --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/accessor/not-allowed-on-methods/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (2:14)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/accessor/private-accessor/input.js b/packages/babel-parser/test/fixtures/experimental/accessor/private-accessor/input.js new file mode 100644 index 000000000000..9127772fc36b --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/accessor/private-accessor/input.js @@ -0,0 +1,3 @@ +class Foo { + accessor #bar; +} diff --git a/packages/babel-parser/test/fixtures/experimental/accessor/private-accessor/output.json b/packages/babel-parser/test/fixtures/experimental/accessor/private-accessor/output.json new file mode 100644 index 000000000000..e740f04334c6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/accessor/private-accessor/output.json @@ -0,0 +1,46 @@ +{ + "type": "File", + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, + "program": { + "type": "Program", + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, + "id": { + "type": "Identifier", + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9},"identifierName":"Foo"}, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start":10,"end":30,"loc":{"start":{"line":1,"column":10},"end":{"line":3,"column":1}}, + "body": [ + { + "type": "ClassPrivateProperty", + "start":14,"end":28,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, + "static": false, + "key": { + "type": "PrivateName", + "start":23,"end":27,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":15}}, + "id": { + "type": "Identifier", + "start":24,"end":27,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":15},"identifierName":"bar"}, + "name": "bar" + } + }, + "computed": false, + "accessor": true, + "value": null + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-static-block/await-binding-in-initializer-in-static-block/output.json b/packages/babel-parser/test/fixtures/experimental/class-static-block/await-binding-in-initializer-in-static-block/output.json index 77baeecac2fe..6e21d9728b40 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-static-block/await-binding-in-initializer-in-static-block/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-static-block/await-binding-in-initializer-in-static-block/output.json @@ -72,6 +72,7 @@ "name": "x" }, "computed": false, + "accessor": false, "value": { "type": "Identifier", "start":43,"end":48,"loc":{"start":{"line":3,"column":35},"end":{"line":3,"column":40},"identifierName":"await"}, diff --git a/packages/babel-parser/test/fixtures/experimental/class-static-block/await-binding-in-static-block/output.json b/packages/babel-parser/test/fixtures/experimental/class-static-block/await-binding-in-static-block/output.json index ce70f8312e1a..15a7be8d5ad3 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-static-block/await-binding-in-static-block/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-static-block/await-binding-in-static-block/output.json @@ -440,6 +440,7 @@ "start":401,"end":406,"loc":{"start":{"line":15,"column":32},"end":{"line":15,"column":37},"identifierName":"await"}, "name": "await" }, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/class-property/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/class-property/output.json index d3973e7ce798..ce2b775092c7 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/class-property/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/class-property/output.json @@ -41,6 +41,7 @@ "name": "name" }, "computed": false, + "accessor": false, "value": { "type": "NumericLiteral", "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15}}, diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/private-property/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/private-property/output.json index 5ffd41290834..0cdf0bed6fff 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/private-property/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/private-property/output.json @@ -44,6 +44,7 @@ "name": "name" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":25,"end":26,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":16}}, diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/static-property/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/static-property/output.json index eb62fec97a53..430be848a62f 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/static-property/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/static-property/output.json @@ -41,6 +41,7 @@ "name": "name" }, "computed": false, + "accessor": false, "value": { "type": "NumericLiteral", "start":31,"end":32,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":22}}, diff --git a/packages/babel-parser/test/fixtures/experimental/decorators/computed-member-expr-on-prop/output.json b/packages/babel-parser/test/fixtures/experimental/decorators/computed-member-expr-on-prop/output.json index 153a2fef0aa5..f4556558de33 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators/computed-member-expr-on-prop/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators/computed-member-expr-on-prop/output.json @@ -35,12 +35,12 @@ "start":15,"end":18,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":6},"identifierName":"foo"}, "name": "foo" }, + "computed": true, "property": { "type": "Identifier", "start":19,"end":22,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":10},"identifierName":"bar"}, "name": "bar" - }, - "computed": true + } } } ], @@ -51,6 +51,7 @@ "name": "a" }, "computed": false, + "accessor": false, "value": { "type": "NumericLiteral", "start":28,"end":29,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":17}}, diff --git a/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-class-in-module-blocks/output.json b/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-class-in-module-blocks/output.json index 3326a47bcd8b..08b7ca111e21 100644 --- a/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-class-in-module-blocks/output.json +++ b/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-class-in-module-blocks/output.json @@ -93,6 +93,7 @@ } } }, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/experimental/module-blocks/valid-class-in-module-blocks/output.json b/packages/babel-parser/test/fixtures/experimental/module-blocks/valid-class-in-module-blocks/output.json index 8f9f2543972c..47d084e9b51e 100644 --- a/packages/babel-parser/test/fixtures/experimental/module-blocks/valid-class-in-module-blocks/output.json +++ b/packages/babel-parser/test/fixtures/experimental/module-blocks/valid-class-in-module-blocks/output.json @@ -90,6 +90,7 @@ } } }, + "accessor": false, "value": null }, { @@ -105,6 +106,7 @@ "name": "p" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":80,"end":81,"loc":{"start":{"line":6,"column":13},"end":{"line":6,"column":14}}, diff --git a/packages/babel-parser/test/fixtures/experimental/private-in/private-binary-expression-left/output.json b/packages/babel-parser/test/fixtures/experimental/private-in/private-binary-expression-left/output.json index bb4be6f0b83c..c150abf65a47 100644 --- a/packages/babel-parser/test/fixtures/experimental/private-in/private-binary-expression-left/output.json +++ b/packages/babel-parser/test/fixtures/experimental/private-in/private-binary-expression-left/output.json @@ -36,6 +36,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":19,"end":20,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, diff --git a/packages/babel-parser/test/fixtures/experimental/private-in/private-binary-expression-right/output.json b/packages/babel-parser/test/fixtures/experimental/private-in/private-binary-expression-right/output.json index 937249312e48..369d23135543 100644 --- a/packages/babel-parser/test/fixtures/experimental/private-in/private-binary-expression-right/output.json +++ b/packages/babel-parser/test/fixtures/experimental/private-in/private-binary-expression-right/output.json @@ -36,6 +36,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":19,"end":20,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, diff --git a/packages/babel-parser/test/fixtures/experimental/private-in/private-expression/output.json b/packages/babel-parser/test/fixtures/experimental/private-in/private-expression/output.json index 0c4896736ec7..5c5cc9253f75 100644 --- a/packages/babel-parser/test/fixtures/experimental/private-in/private-expression/output.json +++ b/packages/babel-parser/test/fixtures/experimental/private-in/private-expression/output.json @@ -36,6 +36,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":19,"end":20,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, diff --git a/packages/babel-parser/test/fixtures/experimental/private-in/private-in-class-heritage/output.json b/packages/babel-parser/test/fixtures/experimental/private-in/private-in-class-heritage/output.json index fb316b24404d..b882311ec813 100644 --- a/packages/babel-parser/test/fixtures/experimental/private-in/private-in-class-heritage/output.json +++ b/packages/babel-parser/test/fixtures/experimental/private-in/private-in-class-heritage/output.json @@ -33,6 +33,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":19,"end":20,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, @@ -73,6 +74,10 @@ "superClass": { "type": "BinaryExpression", "start":54,"end":62,"loc":{"start":{"line":4,"column":21},"end":{"line":4,"column":29}}, + "extra": { + "parenthesized": true, + "parenStart": 53 + }, "left": { "type": "PrivateName", "start":54,"end":56,"loc":{"start":{"line":4,"column":21},"end":{"line":4,"column":23}}, @@ -87,10 +92,6 @@ "type": "ObjectExpression", "start":60,"end":62,"loc":{"start":{"line":4,"column":27},"end":{"line":4,"column":29}}, "properties": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 53 } }, "body": { diff --git a/packages/babel-parser/test/fixtures/experimental/private-in/private-in-escaped-sequence/output.json b/packages/babel-parser/test/fixtures/experimental/private-in/private-in-escaped-sequence/output.json index 1e1d2919424f..5ec1e282ae9a 100644 --- a/packages/babel-parser/test/fixtures/experimental/private-in/private-in-escaped-sequence/output.json +++ b/packages/babel-parser/test/fixtures/experimental/private-in/private-in-escaped-sequence/output.json @@ -33,6 +33,7 @@ "name": "a" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":24,"end":25,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13}}, diff --git a/packages/babel-parser/test/fixtures/experimental/private-in/private-in-parenthesized/output.json b/packages/babel-parser/test/fixtures/experimental/private-in/private-in-parenthesized/output.json index b6196e5fc62c..8621ebc01cb5 100644 --- a/packages/babel-parser/test/fixtures/experimental/private-in/private-in-parenthesized/output.json +++ b/packages/babel-parser/test/fixtures/experimental/private-in/private-in-parenthesized/output.json @@ -36,6 +36,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":19,"end":20,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, diff --git a/packages/babel-parser/test/fixtures/experimental/private-in/private-in/output.json b/packages/babel-parser/test/fixtures/experimental/private-in/private-in/output.json index 20550bc95856..77b8f7000a35 100644 --- a/packages/babel-parser/test/fixtures/experimental/private-in/private-in/output.json +++ b/packages/babel-parser/test/fixtures/experimental/private-in/private-in/output.json @@ -33,6 +33,7 @@ "name": "x" } }, + "accessor": false, "value": { "type": "NumericLiteral", "start":19,"end":20,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-class-property/output.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-class-property/output.json index 1a605c119399..940b3708f02a 100644 --- a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-class-property/output.json +++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-class-property/output.json @@ -38,6 +38,7 @@ "name": "p" }, "computed": false, + "accessor": false, "value": { "type": "AwaitExpression", "start":23,"end":30,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":13}}, diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-property-key/output.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-property-key/output.json index 102d9c9a0642..8f4f301f082e 100644 --- a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-property-key/output.json +++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-property-key/output.json @@ -38,6 +38,7 @@ "value": 0 } }, + "accessor": false, "value": { "type": "ArrowFunctionExpression", "start":24,"end":32,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":22}}, diff --git a/packages/babel-parser/test/fixtures/experimental/uncategorised/43/output.json b/packages/babel-parser/test/fixtures/experimental/uncategorised/43/output.json index 85cdb8bc35c3..3968808709c1 100644 --- a/packages/babel-parser/test/fixtures/experimental/uncategorised/43/output.json +++ b/packages/babel-parser/test/fixtures/experimental/uncategorised/43/output.json @@ -30,6 +30,7 @@ "name": "foo" }, "computed": false, + "accessor": false, "value": { "type": "StringLiteral", "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, diff --git a/packages/babel-parser/test/fixtures/experimental/uncategorised/44/output.json b/packages/babel-parser/test/fixtures/experimental/uncategorised/44/output.json index 52faf1f98373..0027993ef4db 100644 --- a/packages/babel-parser/test/fixtures/experimental/uncategorised/44/output.json +++ b/packages/babel-parser/test/fixtures/experimental/uncategorised/44/output.json @@ -30,6 +30,7 @@ "name": "foo" }, "computed": false, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/experimental/uncategorised/45/output.json b/packages/babel-parser/test/fixtures/experimental/uncategorised/45/output.json index 9c1064e402f4..416c99c87d18 100644 --- a/packages/babel-parser/test/fixtures/experimental/uncategorised/45/output.json +++ b/packages/babel-parser/test/fixtures/experimental/uncategorised/45/output.json @@ -30,6 +30,7 @@ "name": "foo" }, "computed": false, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/experimental/uncategorised/46/output.json b/packages/babel-parser/test/fixtures/experimental/uncategorised/46/output.json index 0c47e0453e3a..4e4878c9d865 100644 --- a/packages/babel-parser/test/fixtures/experimental/uncategorised/46/output.json +++ b/packages/babel-parser/test/fixtures/experimental/uncategorised/46/output.json @@ -30,6 +30,7 @@ "name": "foo" }, "computed": false, + "accessor": false, "value": { "type": "StringLiteral", "start":25,"end":30,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":30}}, diff --git a/packages/babel-parser/test/fixtures/experimental/uncategorised/47/output.json b/packages/babel-parser/test/fixtures/experimental/uncategorised/47/output.json index 0157ee146fc6..97085606158f 100644 --- a/packages/babel-parser/test/fixtures/experimental/uncategorised/47/output.json +++ b/packages/babel-parser/test/fixtures/experimental/uncategorised/47/output.json @@ -41,6 +41,7 @@ "name": "foo" }, "computed": false, + "accessor": false, "value": { "type": "StringLiteral", "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28}}, diff --git a/packages/babel-parser/test/fixtures/experimental/uncategorised/48/output.json b/packages/babel-parser/test/fixtures/experimental/uncategorised/48/output.json index aa726dbfc5fd..ff0b73bf2464 100644 --- a/packages/babel-parser/test/fixtures/experimental/uncategorised/48/output.json +++ b/packages/babel-parser/test/fixtures/experimental/uncategorised/48/output.json @@ -41,6 +41,7 @@ "name": "foo" }, "computed": false, + "accessor": false, "value": { "type": "StringLiteral", "start":30,"end":35,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":35}}, diff --git a/packages/babel-parser/test/fixtures/flow/class-private-property/1/output.json b/packages/babel-parser/test/fixtures/flow/class-private-property/1/output.json index 7ec235864e56..aef31bc5f1b7 100644 --- a/packages/babel-parser/test/fixtures/flow/class-private-property/1/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-private-property/1/output.json @@ -34,6 +34,7 @@ } }, "variance": null, + "accessor": false, "typeAnnotation": { "type": "TypeAnnotation", "start":18,"end":26,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":16}}, @@ -58,6 +59,7 @@ } }, "variance": null, + "accessor": false, "typeAnnotation": { "type": "TypeAnnotation", "start":36,"end":44,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":16}}, diff --git a/packages/babel-parser/test/fixtures/flow/class-private-property/2/output.json b/packages/babel-parser/test/fixtures/flow/class-private-property/2/output.json index 6d1a17645506..4cbf6df1e045 100644 --- a/packages/babel-parser/test/fixtures/flow/class-private-property/2/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-private-property/2/output.json @@ -34,6 +34,7 @@ } }, "variance": null, + "accessor": false, "typeAnnotation": { "type": "TypeAnnotation", "start":18,"end":26,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":16}}, @@ -58,6 +59,7 @@ } }, "variance": null, + "accessor": false, "typeAnnotation": { "type": "TypeAnnotation", "start":36,"end":44,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":16}}, diff --git a/packages/babel-parser/test/fixtures/flow/class-private-property/declare-field-initializer/output.json b/packages/babel-parser/test/fixtures/flow/class-private-property/declare-field-initializer/output.json index 7b64fc114305..62db6eff93e4 100644 --- a/packages/babel-parser/test/fixtures/flow/class-private-property/declare-field-initializer/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-private-property/declare-field-initializer/output.json @@ -38,6 +38,7 @@ } }, "variance": null, + "accessor": false, "value": { "type": "NumericLiteral", "start":27,"end":28,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":18}}, diff --git a/packages/babel-parser/test/fixtures/flow/class-private-property/declare-field/output.json b/packages/babel-parser/test/fixtures/flow/class-private-property/declare-field/output.json index 0bbd5e95ce0e..10278ea5e00a 100644 --- a/packages/babel-parser/test/fixtures/flow/class-private-property/declare-field/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-private-property/declare-field/output.json @@ -35,6 +35,7 @@ } }, "variance": null, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/flow/class-properties/declare-after-decorators/output.json b/packages/babel-parser/test/fixtures/flow/class-properties/declare-after-decorators/output.json index db8d95413d43..0697c8eda248 100644 --- a/packages/babel-parser/test/fixtures/flow/class-properties/declare-after-decorators/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-properties/declare-after-decorators/output.json @@ -43,6 +43,7 @@ }, "computed": false, "variance": null, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/flow/class-properties/declare-field-computed/output.json b/packages/babel-parser/test/fixtures/flow/class-properties/declare-field-computed/output.json index 206e08e2cbe0..34435f87d5e4 100644 --- a/packages/babel-parser/test/fixtures/flow/class-properties/declare-field-computed/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-properties/declare-field-computed/output.json @@ -32,6 +32,7 @@ "name": "foo" }, "variance": null, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/flow/class-properties/declare-field-initializer/output.json b/packages/babel-parser/test/fixtures/flow/class-properties/declare-field-initializer/output.json index 8786c334ee5a..bfac3be00053 100644 --- a/packages/babel-parser/test/fixtures/flow/class-properties/declare-field-initializer/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-properties/declare-field-initializer/output.json @@ -35,6 +35,7 @@ }, "computed": false, "variance": null, + "accessor": false, "value": { "type": "NumericLiteral", "start":26,"end":27,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":17}}, diff --git a/packages/babel-parser/test/fixtures/flow/class-properties/declare-field-named-static/output.json b/packages/babel-parser/test/fixtures/flow/class-properties/declare-field-named-static/output.json index 6b674fc50fc6..275cabdb5e7e 100644 --- a/packages/babel-parser/test/fixtures/flow/class-properties/declare-field-named-static/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-properties/declare-field-named-static/output.json @@ -31,6 +31,7 @@ "name": "static" }, "static": false, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/flow/class-properties/declare-field-with-type/output.json b/packages/babel-parser/test/fixtures/flow/class-properties/declare-field-with-type/output.json index 596dd7518653..0aa0b205a2e8 100644 --- a/packages/babel-parser/test/fixtures/flow/class-properties/declare-field-with-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-properties/declare-field-with-type/output.json @@ -32,6 +32,7 @@ }, "computed": false, "variance": null, + "accessor": false, "typeAnnotation": { "type": "TypeAnnotation", "start":23,"end":31,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":21}}, diff --git a/packages/babel-parser/test/fixtures/flow/class-properties/declare-field/output.json b/packages/babel-parser/test/fixtures/flow/class-properties/declare-field/output.json index 3e9472582d84..9cd5db65a41c 100644 --- a/packages/babel-parser/test/fixtures/flow/class-properties/declare-field/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-properties/declare-field/output.json @@ -32,6 +32,7 @@ }, "computed": false, "variance": null, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/flow/class-properties/declare-static-field/output.json b/packages/babel-parser/test/fixtures/flow/class-properties/declare-static-field/output.json index 4df0de125108..8c82fed21d69 100644 --- a/packages/babel-parser/test/fixtures/flow/class-properties/declare-static-field/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-properties/declare-static-field/output.json @@ -32,6 +32,7 @@ }, "computed": false, "variance": null, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/flow/class-properties/field-named-declare-with-type/output.json b/packages/babel-parser/test/fixtures/flow/class-properties/field-named-declare-with-type/output.json index 60aed8369054..973c4d1f1923 100644 --- a/packages/babel-parser/test/fixtures/flow/class-properties/field-named-declare-with-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-properties/field-named-declare-with-type/output.json @@ -30,6 +30,7 @@ "name": "declare" }, "static": false, + "accessor": false, "typeAnnotation": { "type": "TypeAnnotation", "start":19,"end":27,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":17}}, diff --git a/packages/babel-parser/test/fixtures/flow/class-properties/field-named-declare/output.json b/packages/babel-parser/test/fixtures/flow/class-properties/field-named-declare/output.json index 70b00851f80f..b1a3f68e7047 100644 --- a/packages/babel-parser/test/fixtures/flow/class-properties/field-named-declare/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-properties/field-named-declare/output.json @@ -30,6 +30,7 @@ "name": "declare" }, "static": false, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/flow/class-properties/static-field-named-declare/output.json b/packages/babel-parser/test/fixtures/flow/class-properties/static-field-named-declare/output.json index 9b452767270d..eb79487374bf 100644 --- a/packages/babel-parser/test/fixtures/flow/class-properties/static-field-named-declare/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-properties/static-field-named-declare/output.json @@ -31,6 +31,7 @@ }, "computed": false, "variance": null, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/flow/classes/constructor-override-with-class-prop-plugin/output.json b/packages/babel-parser/test/fixtures/flow/classes/constructor-override-with-class-prop-plugin/output.json index 1e4afb6959a7..6fdd5eb421c3 100644 --- a/packages/babel-parser/test/fixtures/flow/classes/constructor-override-with-class-prop-plugin/output.json +++ b/packages/babel-parser/test/fixtures/flow/classes/constructor-override-with-class-prop-plugin/output.json @@ -34,6 +34,7 @@ }, "computed": false, "variance": null, + "accessor": false, "typeAnnotation": { "type": "TypeAnnotation", "start":25,"end":37,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":25}}, diff --git a/packages/babel-parser/test/fixtures/flow/classes/good_01/output.json b/packages/babel-parser/test/fixtures/flow/classes/good_01/output.json index 6a86583fe75d..e5ef33972341 100644 --- a/packages/babel-parser/test/fixtures/flow/classes/good_01/output.json +++ b/packages/babel-parser/test/fixtures/flow/classes/good_01/output.json @@ -31,6 +31,7 @@ }, "computed": false, "variance": null, + "accessor": false, "typeAnnotation": { "type": "TypeAnnotation", "start":15,"end":17,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":17}}, diff --git a/packages/babel-parser/test/fixtures/flow/comment/01-type-include/output.json b/packages/babel-parser/test/fixtures/flow/comment/01-type-include/output.json index 825d11b9844e..c286ae84c68b 100644 --- a/packages/babel-parser/test/fixtures/flow/comment/01-type-include/output.json +++ b/packages/babel-parser/test/fixtures/flow/comment/01-type-include/output.json @@ -31,6 +31,7 @@ }, "computed": false, "variance": null, + "accessor": false, "typeAnnotation": { "type": "TypeAnnotation", "start":30,"end":38,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":22}}, @@ -52,6 +53,7 @@ }, "computed": false, "variance": null, + "accessor": false, "typeAnnotation": { "type": "TypeAnnotation", "start":60,"end":68,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":25}}, diff --git a/packages/babel-parser/test/fixtures/flow/comment/04-type-flow-include/output.json b/packages/babel-parser/test/fixtures/flow/comment/04-type-flow-include/output.json index 27ae356bb388..a8a41923e0ff 100644 --- a/packages/babel-parser/test/fixtures/flow/comment/04-type-flow-include/output.json +++ b/packages/babel-parser/test/fixtures/flow/comment/04-type-flow-include/output.json @@ -31,6 +31,7 @@ }, "computed": false, "variance": null, + "accessor": false, "typeAnnotation": { "type": "TypeAnnotation", "start":43,"end":51,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":35}}, @@ -52,6 +53,7 @@ }, "computed": false, "variance": null, + "accessor": false, "typeAnnotation": { "type": "TypeAnnotation", "start":85,"end":93,"loc":{"start":{"line":3,"column":29},"end":{"line":3,"column":37}}, diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/118/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/118/output.json index 19cd5a6c089d..1d9293689ccd 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/118/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/118/output.json @@ -35,6 +35,7 @@ "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10}}, "kind": "plus" }, + "accessor": false, "typeAnnotation": { "type": "TypeAnnotation", "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/119/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/119/output.json index 8b942e9bdc1a..b1298458c305 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/119/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/119/output.json @@ -35,6 +35,7 @@ "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10}}, "kind": "minus" }, + "accessor": false, "typeAnnotation": { "type": "TypeAnnotation", "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/53/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/53/output.json index 5115a9a3f165..03eac4cae36c 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/53/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/53/output.json @@ -31,6 +31,7 @@ }, "computed": false, "variance": null, + "accessor": false, "typeAnnotation": { "type": "TypeAnnotation", "start":17,"end":24,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":24}}, @@ -52,6 +53,7 @@ }, "computed": false, "variance": null, + "accessor": false, "typeAnnotation": { "type": "TypeAnnotation", "start":31,"end":38,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":38}}, diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/54/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/54/output.json index 7ce1b31f8b2c..19c546a4ef85 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/54/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/54/output.json @@ -31,6 +31,7 @@ }, "computed": false, "variance": null, + "accessor": false, "typeAnnotation": { "type": "TypeAnnotation", "start":24,"end":31,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":31}}, @@ -52,6 +53,7 @@ }, "computed": false, "variance": null, + "accessor": false, "typeAnnotation": { "type": "TypeAnnotation", "start":38,"end":45,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":45}}, diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this-with-predicate/output.json b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this-with-predicate/output.json index 8a552c9028ad..4a5813234a99 100644 --- a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this-with-predicate/output.json +++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this-with-predicate/output.json @@ -78,6 +78,7 @@ "name": "isBaz" }, "computed": false, + "accessor": false, "value": { "type": "ArrowFunctionExpression", "start":56,"end":85,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":39}}, @@ -125,4 +126,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/class/abstract-method-in-non-abstract-class-3/output.json b/packages/babel-parser/test/fixtures/typescript/class/abstract-method-in-non-abstract-class-3/output.json index ff36ce77b1c7..949698914744 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/abstract-method-in-non-abstract-class-3/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/abstract-method-in-non-abstract-class-3/output.json @@ -34,6 +34,7 @@ "name": "p" }, "computed": false, + "accessor": false, "value": { "type": "ClassExpression", "start":23,"end":50,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":50}}, diff --git a/packages/babel-parser/test/fixtures/typescript/class/async-named-properties/output.json b/packages/babel-parser/test/fixtures/typescript/class/async-named-properties/output.json index 2eb4a2e8912b..8b480c48ba58 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/async-named-properties/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/async-named-properties/output.json @@ -56,6 +56,7 @@ }, "computed": false, "optional": true, + "accessor": false, "typeAnnotation": { "type": "TSTypeAnnotation", "start":35,"end":44,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":17}}, diff --git a/packages/babel-parser/test/fixtures/typescript/class/declare-field-initializer/output.json b/packages/babel-parser/test/fixtures/typescript/class/declare-field-initializer/output.json index c7c1398ea0f3..f3a09209dfd1 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/declare-field-initializer/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/declare-field-initializer/output.json @@ -34,6 +34,7 @@ "name": "bar" }, "computed": false, + "accessor": false, "typeAnnotation": { "type": "TSTypeAnnotation", "start":23,"end":31,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":21}}, diff --git a/packages/babel-parser/test/fixtures/typescript/class/declare-field-modifiers/output.json b/packages/babel-parser/test/fixtures/typescript/class/declare-field-modifiers/output.json index f5caff15c0c2..f733ec53b532 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/declare-field-modifiers/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/declare-field-modifiers/output.json @@ -31,19 +31,21 @@ "name": "foo" }, "computed": false, + "accessor": false, "value": null }, { "type": "ClassProperty", "start":34,"end":62,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":30}}, - "declare": true, "static": true, + "declare": true, "key": { "type": "Identifier", "start":49,"end":53,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":21},"identifierName":"foo0"}, "name": "foo0" }, "computed": false, + "accessor": false, "typeAnnotation": { "type": "TSTypeAnnotation", "start":53,"end":61,"loc":{"start":{"line":3,"column":21},"end":{"line":3,"column":29}}, @@ -66,6 +68,7 @@ "name": "foo1" }, "computed": false, + "accessor": false, "value": null }, { @@ -80,6 +83,7 @@ "name": "foo2" }, "computed": false, + "accessor": false, "value": null }, { @@ -94,6 +98,7 @@ "name": "foo4" }, "computed": false, + "accessor": false, "value": null }, { @@ -108,20 +113,22 @@ "name": "foo3" }, "computed": false, + "accessor": false, "value": null }, { "type": "ClassProperty", "start":173,"end":200,"loc":{"start":{"line":10,"column":2},"end":{"line":10,"column":29}}, "accessibility": "public", - "declare": true, "static": true, + "declare": true, "key": { "type": "Identifier", "start":195,"end":199,"loc":{"start":{"line":10,"column":24},"end":{"line":10,"column":28},"identifierName":"foo5"}, "name": "foo5" }, "computed": false, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/typescript/class/declare-field/output.json b/packages/babel-parser/test/fixtures/typescript/class/declare-field/output.json index 6019ac5ff859..394c9b84d600 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/declare-field/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/declare-field/output.json @@ -31,6 +31,7 @@ "name": "foo" }, "computed": false, + "accessor": false, "value": null }, { @@ -44,6 +45,7 @@ "name": "bar" }, "computed": false, + "accessor": false, "typeAnnotation": { "type": "TSTypeAnnotation", "start":38,"end":46,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":21}}, diff --git a/packages/babel-parser/test/fixtures/typescript/class/declare-get-set-field/output.json b/packages/babel-parser/test/fixtures/typescript/class/declare-get-set-field/output.json index 5c5e5704397b..232ab7c82200 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/declare-get-set-field/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/declare-get-set-field/output.json @@ -31,6 +31,7 @@ "name": "get" }, "computed": false, + "accessor": false, "typeAnnotation": { "type": "TSTypeAnnotation", "start":23,"end":31,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":21}}, @@ -52,6 +53,7 @@ "name": "set" }, "computed": false, + "accessor": false, "typeAnnotation": { "type": "TSTypeAnnotation", "start":45,"end":53,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":21}}, diff --git a/packages/babel-parser/test/fixtures/typescript/class/declare-initializer/output.json b/packages/babel-parser/test/fixtures/typescript/class/declare-initializer/output.json index 1c94185430d2..0b36602162e3 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/declare-initializer/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/declare-initializer/output.json @@ -34,6 +34,7 @@ "name": "field" }, "computed": false, + "accessor": false, "value": { "type": "StringLiteral", "start":28,"end":35,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":17}}, diff --git a/packages/babel-parser/test/fixtures/typescript/class/declare/output.json b/packages/babel-parser/test/fixtures/typescript/class/declare/output.json index 05defba81f38..e150cc9406f0 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/declare/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/declare/output.json @@ -58,6 +58,7 @@ "name": "x" }, "computed": false, + "accessor": false, "value": null }, { @@ -70,6 +71,7 @@ "name": "x" }, "computed": false, + "accessor": false, "typeAnnotation": { "type": "TSTypeAnnotation", "start":52,"end":60,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":13}}, diff --git a/packages/babel-parser/test/fixtures/typescript/class/duplicate-modifier-1/output.json b/packages/babel-parser/test/fixtures/typescript/class/duplicate-modifier-1/output.json index 17e2af85eb86..c2304eed2207 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/duplicate-modifier-1/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/duplicate-modifier-1/output.json @@ -35,6 +35,7 @@ "name": "foo" }, "computed": false, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/typescript/class/duplicate-modifier-2/output.json b/packages/babel-parser/test/fixtures/typescript/class/duplicate-modifier-2/output.json index e8183c3919ae..27e499458a82 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/duplicate-modifier-2/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/duplicate-modifier-2/output.json @@ -35,6 +35,7 @@ "name": "foo" }, "computed": false, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/typescript/class/duplicates-accessibility/output.json b/packages/babel-parser/test/fixtures/typescript/class/duplicates-accessibility/output.json index 8f1fde109674..6221ae2b84e7 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/duplicates-accessibility/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/duplicates-accessibility/output.json @@ -39,6 +39,7 @@ "name": "a" }, "computed": false, + "accessor": false, "value": null }, { @@ -52,6 +53,7 @@ "name": "b" }, "computed": false, + "accessor": false, "value": null }, { @@ -65,6 +67,7 @@ "name": "c" }, "computed": false, + "accessor": false, "value": null }, { @@ -78,6 +81,7 @@ "name": "d" }, "computed": false, + "accessor": false, "value": null }, { @@ -91,6 +95,7 @@ "name": "e" }, "computed": false, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/typescript/class/invalid-modifiers-order/output.json b/packages/babel-parser/test/fixtures/typescript/class/invalid-modifiers-order/output.json index 3eb82ef8f26f..08783d2c6785 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/invalid-modifiers-order/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/invalid-modifiers-order/output.json @@ -43,6 +43,7 @@ "name": "foo1" }, "computed": false, + "accessor": false, "typeAnnotation": { "type": "TSTypeAnnotation", "start":47,"end":55,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":31}}, @@ -65,6 +66,7 @@ "name": "foo2" }, "computed": false, + "accessor": false, "typeAnnotation": { "type": "TSTypeAnnotation", "start":79,"end":87,"loc":{"start":{"line":3,"column":23},"end":{"line":3,"column":31}}, @@ -88,6 +90,7 @@ "name": "foo3" }, "computed": false, + "accessor": false, "typeAnnotation": { "type": "TSTypeAnnotation", "start":121,"end":129,"loc":{"start":{"line":4,"column":32},"end":{"line":4,"column":40}}, @@ -111,6 +114,7 @@ "name": "foo4" }, "computed": false, + "accessor": false, "typeAnnotation": { "type": "TSTypeAnnotation", "start":163,"end":171,"loc":{"start":{"line":5,"column":32},"end":{"line":5,"column":40}}, diff --git a/packages/babel-parser/test/fixtures/typescript/class/members-with-modifier-names-babel-7/output.json b/packages/babel-parser/test/fixtures/typescript/class/members-with-modifier-names-babel-7/output.json index 6619ed4663eb..856ece7aecae 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/members-with-modifier-names-babel-7/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/members-with-modifier-names-babel-7/output.json @@ -48,14 +48,14 @@ "type": "TSDeclareMethod", "start":34,"end":56,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":26}}, "accessibility": "public", - "kind": "method", - "computed": false, + "static": false, "key": { "type": "Identifier", "start":41,"end":47,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":17},"identifierName":"static"}, "name": "static" }, - "static": false, + "computed": false, + "kind": "method", "id": null, "generator": false, "async": false, @@ -79,6 +79,7 @@ "name": "readonly" }, "computed": false, + "accessor": false, "value": { "type": "NumericLiteral", "start":72,"end":73,"loc":{"start":{"line":4,"column":15},"end":{"line":4,"column":16}}, @@ -134,6 +135,7 @@ "name": "abstract" }, "computed": false, + "accessor": false, "definite": true, "typeAnnotation": { "type": "TSTypeAnnotation", diff --git a/packages/babel-parser/test/fixtures/typescript/class/modifiers-incompatible/output.json b/packages/babel-parser/test/fixtures/typescript/class/modifiers-incompatible/output.json index a0ffbf7b019e..e19cf1845560 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/modifiers-incompatible/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/modifiers-incompatible/output.json @@ -77,6 +77,7 @@ "name": "prop1" }, "computed": false, + "accessor": false, "typeAnnotation": { "type": "TSTypeAnnotation", "start":105,"end":110,"loc":{"start":{"line":5,"column":24},"end":{"line":5,"column":29}}, @@ -99,6 +100,7 @@ "name": "prop2" }, "computed": false, + "accessor": false, "typeAnnotation": { "type": "TSTypeAnnotation", "start":136,"end":141,"loc":{"start":{"line":6,"column":24},"end":{"line":6,"column":29}}, diff --git a/packages/babel-parser/test/fixtures/typescript/class/modifiers-invalid-order/output.json b/packages/babel-parser/test/fixtures/typescript/class/modifiers-invalid-order/output.json index 858e2bba559b..8226630a982b 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/modifiers-invalid-order/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/modifiers-invalid-order/output.json @@ -94,6 +94,7 @@ "name": "p4" }, "computed": false, + "accessor": false, "value": null }, { @@ -108,6 +109,7 @@ "name": "p3" }, "computed": false, + "accessor": false, "value": null }, { diff --git a/packages/babel-parser/test/fixtures/typescript/class/modifiers-override-errors/output.json b/packages/babel-parser/test/fixtures/typescript/class/modifiers-override-errors/output.json index a0182a9984d9..4b38a9dcd0bc 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/modifiers-override-errors/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/modifiers-override-errors/output.json @@ -107,6 +107,7 @@ "name": "prop" }, "computed": false, + "accessor": false, "typeAnnotation": { "type": "TSTypeAnnotation", "start":127,"end":132,"loc":{"start":{"line":7,"column":15},"end":{"line":7,"column":20}}, diff --git a/packages/babel-parser/test/fixtures/typescript/class/modifiers-override/output.json b/packages/babel-parser/test/fixtures/typescript/class/modifiers-override/output.json index 0308713d4a6d..92b169e2e6b5 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/modifiers-override/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/modifiers-override/output.json @@ -82,6 +82,7 @@ "name": "size" }, "computed": false, + "accessor": false, "value": { "type": "NumericLiteral", "start":101,"end":102,"loc":{"start":{"line":4,"column":18},"end":{"line":4,"column":19}}, @@ -104,6 +105,7 @@ "name": "size" }, "computed": false, + "accessor": false, "value": { "type": "NumericLiteral", "start":131,"end":132,"loc":{"start":{"line":5,"column":27},"end":{"line":5,"column":28}}, @@ -200,6 +202,7 @@ "start":232,"end":233,"loc":{"start":{"line":12,"column":12},"end":{"line":12,"column":13},"identifierName":"x"}, "name": "x" }, + "accessor": false, "value": { "type": "NumericLiteral", "start":237,"end":238,"loc":{"start":{"line":12,"column":17},"end":{"line":12,"column":18}}, diff --git a/packages/babel-parser/test/fixtures/typescript/class/modifiers-properties/output.json b/packages/babel-parser/test/fixtures/typescript/class/modifiers-properties/output.json index 7f16ab4af1cf..8ef4d689344b 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/modifiers-properties/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/modifiers-properties/output.json @@ -32,6 +32,7 @@ "name": "r" }, "computed": false, + "accessor": false, "value": null }, { @@ -46,6 +47,7 @@ }, "computed": false, "optional": true, + "accessor": false, "typeAnnotation": { "type": "TSTypeAnnotation", "start":51,"end":59,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":24}}, @@ -67,6 +69,7 @@ "name": "a" }, "computed": false, + "accessor": false, "value": null }, { @@ -79,6 +82,7 @@ "name": "s" }, "computed": false, + "accessor": false, "value": null }, { @@ -92,6 +96,7 @@ "name": "pu" }, "computed": false, + "accessor": false, "value": null }, { @@ -105,6 +110,7 @@ "name": "po" }, "computed": false, + "accessor": false, "value": null }, { @@ -118,6 +124,7 @@ "name": "pi" }, "computed": false, + "accessor": false, "value": null }, { @@ -132,6 +139,7 @@ "name": "ra" }, "computed": false, + "accessor": false, "value": null }, { @@ -146,19 +154,21 @@ "name": "ar" }, "computed": false, + "accessor": false, "value": null }, { "type": "ClassProperty", "start":198,"end":217,"loc":{"start":{"line":13,"column":4},"end":{"line":13,"column":23}}, - "readonly": true, "static": true, + "readonly": true, "key": { "type": "Identifier", "start":214,"end":216,"loc":{"start":{"line":13,"column":20},"end":{"line":13,"column":22},"identifierName":"sr"}, "name": "sr" }, "computed": false, + "accessor": false, "value": null }, { @@ -173,6 +183,7 @@ "name": "pur" }, "computed": false, + "accessor": false, "value": null }, { @@ -187,6 +198,7 @@ "name": "pua" }, "computed": false, + "accessor": false, "value": null }, { @@ -200,6 +212,7 @@ "name": "pus" }, "computed": false, + "accessor": false, "value": null }, { @@ -215,6 +228,7 @@ "name": "pura" }, "computed": false, + "accessor": false, "value": null }, { @@ -230,20 +244,22 @@ "name": "puar" }, "computed": false, + "accessor": false, "value": null }, { "type": "ClassProperty", "start":366,"end":394,"loc":{"start":{"line":20,"column":4},"end":{"line":20,"column":32}}, "accessibility": "public", - "readonly": true, "static": true, + "readonly": true, "key": { "type": "Identifier", "start":389,"end":393,"loc":{"start":{"line":20,"column":27},"end":{"line":20,"column":31},"identifierName":"pusr"}, "name": "pusr" }, "computed": false, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/typescript/class/predicate-types/output.json b/packages/babel-parser/test/fixtures/typescript/class/predicate-types/output.json index e8045b7a6708..ea6f55330317 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/predicate-types/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/predicate-types/output.json @@ -73,6 +73,7 @@ "name": "isBaz" }, "computed": false, + "accessor": false, "value": { "type": "ArrowFunctionExpression", "start":54,"end":81,"loc":{"start":{"line":4,"column":10},"end":{"line":5,"column":3}}, diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/output.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/output.json index 59f5d53634e7..1a26ee26afac 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/output.json @@ -38,6 +38,7 @@ "name": "a" } }, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/output.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/output.json index 655d74e15f97..b1fc706664f0 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/output.json @@ -37,6 +37,7 @@ "name": "a" } }, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/output.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/output.json index 8a42104f41c9..30fc83da5e1f 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/output.json @@ -37,6 +37,7 @@ "name": "a" } }, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/output.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/output.json index 2dcd12502239..6f04567ab341 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/output.json @@ -37,6 +37,7 @@ "name": "a" } }, + "accessor": false, "value": null } ] diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-readonly/output.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-readonly/output.json index d97d1b18bcd0..fe143b9fe57e 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-readonly/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-readonly/output.json @@ -34,6 +34,7 @@ "name": "a" } }, + "accessor": false, "value": null }, { @@ -50,6 +51,7 @@ "name": "b" } }, + "accessor": false, "typeAnnotation": { "type": "TSTypeAnnotation", "start":38,"end":46,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":21}}, diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-static/output.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-static/output.json index 96b576baa8d2..563fa14819e9 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/private-fields-static/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-static/output.json @@ -33,6 +33,7 @@ "name": "x" } }, + "accessor": false, "value": null }, { @@ -48,6 +49,7 @@ "name": "y" } }, + "accessor": false, "typeAnnotation": { "type": "TSTypeAnnotation", "start":34,"end":42,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":19}}, diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields/output.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields/output.json index 6d6a986845db..603773cdf8d1 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/private-fields/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields/output.json @@ -33,6 +33,7 @@ "name": "a" } }, + "accessor": false, "typeAnnotation": { "type": "TSTypeAnnotation", "start":14,"end":22,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":12}}, @@ -57,6 +58,7 @@ } }, "optional": true, + "accessor": false, "value": null }, { @@ -73,6 +75,7 @@ } }, "optional": true, + "accessor": false, "typeAnnotation": { "type": "TSTypeAnnotation", "start":36,"end":44,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":13}}, @@ -96,6 +99,7 @@ "name": "d" } }, + "accessor": false, "definite": true, "value": null }, @@ -112,6 +116,7 @@ "name": "e" } }, + "accessor": false, "definite": true, "typeAnnotation": { "type": "TSTypeAnnotation", diff --git a/packages/babel-parser/test/fixtures/typescript/class/properties/output.json b/packages/babel-parser/test/fixtures/typescript/class/properties/output.json index a0f6801ab6f3..f24f372c4175 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/properties/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/properties/output.json @@ -30,6 +30,7 @@ "name": "x" }, "computed": false, + "accessor": false, "value": null }, { @@ -43,6 +44,7 @@ }, "computed": false, "optional": true, + "accessor": false, "value": null }, { @@ -55,6 +57,7 @@ "name": "x" }, "computed": false, + "accessor": false, "typeAnnotation": { "type": "TSTypeAnnotation", "start":30,"end":38,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":13}}, @@ -75,6 +78,7 @@ "name": "x" }, "computed": false, + "accessor": false, "typeAnnotation": { "type": "TSTypeAnnotation", "start":45,"end":53,"loc":{"start":{"line":5,"column":5},"end":{"line":5,"column":13}}, @@ -103,6 +107,7 @@ "name": "x" }, "computed": false, + "accessor": false, "definite": true, "value": null }, @@ -116,6 +121,7 @@ "name": "x" }, "computed": false, + "accessor": false, "definite": true, "typeAnnotation": { "type": "TSTypeAnnotation", diff --git a/packages/babel-parser/test/fixtures/typescript/class/property-computed/output.json b/packages/babel-parser/test/fixtures/typescript/class/property-computed/output.json index e44bdb7e0136..e13a721ccf3b 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/property-computed/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/property-computed/output.json @@ -33,13 +33,14 @@ "start":15,"end":21,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":11},"identifierName":"Symbol"}, "name": "Symbol" }, + "computed": false, "property": { "type": "Identifier", "start":22,"end":30,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":20},"identifierName":"iterator"}, "name": "iterator" - }, - "computed": false + } }, + "accessor": false, "typeAnnotation": { "type": "TSTypeAnnotation", "start":31,"end":39,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":29}}, @@ -63,14 +64,15 @@ "start":46,"end":52,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":11},"identifierName":"Symbol"}, "name": "Symbol" }, + "computed": false, "property": { "type": "Identifier", "start":53,"end":61,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":20},"identifierName":"iterator"}, "name": "iterator" - }, - "computed": false + } }, "optional": true, + "accessor": false, "typeAnnotation": { "type": "TSTypeAnnotation", "start":63,"end":71,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":30}}, diff --git a/packages/babel-parser/test/fixtures/typescript/declare/module-class/output.json b/packages/babel-parser/test/fixtures/typescript/declare/module-class/output.json index baf67a410c24..fae46796475f 100644 --- a/packages/babel-parser/test/fixtures/typescript/declare/module-class/output.json +++ b/packages/babel-parser/test/fixtures/typescript/declare/module-class/output.json @@ -45,6 +45,7 @@ "name": "field" }, "computed": false, + "accessor": false, "value": { "type": "StringLiteral", "start":43,"end":50,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":19}}, diff --git a/packages/babel-parser/test/fixtures/typescript/declare/namespace-class/output.json b/packages/babel-parser/test/fixtures/typescript/declare/namespace-class/output.json index 503a33e792dd..5cf49794c729 100644 --- a/packages/babel-parser/test/fixtures/typescript/declare/namespace-class/output.json +++ b/packages/babel-parser/test/fixtures/typescript/declare/namespace-class/output.json @@ -45,6 +45,7 @@ "name": "field" }, "computed": false, + "accessor": false, "value": { "type": "StringLiteral", "start":46,"end":53,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":19}}, diff --git a/packages/babel-parser/test/fixtures/typescript/dts/invalid-class-initializer/output.json b/packages/babel-parser/test/fixtures/typescript/dts/invalid-class-initializer/output.json index 2ee49774bff8..a1aba3d02292 100644 --- a/packages/babel-parser/test/fixtures/typescript/dts/invalid-class-initializer/output.json +++ b/packages/babel-parser/test/fixtures/typescript/dts/invalid-class-initializer/output.json @@ -33,6 +33,7 @@ "name": "foo" }, "computed": false, + "accessor": false, "value": { "type": "NumericLiteral", "start":20,"end":21,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9}}, diff --git a/packages/babel-parser/test/fixtures/typescript/regression/async-arrow-generic-9560-babel-7/output.json b/packages/babel-parser/test/fixtures/typescript/regression/async-arrow-generic-9560-babel-7/output.json index 967a411d65cf..b1450b7c9ef6 100644 --- a/packages/babel-parser/test/fixtures/typescript/regression/async-arrow-generic-9560-babel-7/output.json +++ b/packages/babel-parser/test/fixtures/typescript/regression/async-arrow-generic-9560-babel-7/output.json @@ -30,6 +30,7 @@ "name": "a" }, "computed": false, + "accessor": false, "value": { "type": "ArrowFunctionExpression", "start":17,"end":49,"loc":{"start":{"line":2,"column":6},"end":{"line":4,"column":3}}, @@ -84,6 +85,7 @@ "name": "b" }, "computed": false, + "accessor": false, "value": { "type": "ArrowFunctionExpression", "start":58,"end":77,"loc":{"start":{"line":6,"column":6},"end":{"line":7,"column":3}}, diff --git a/packages/babel-parser/test/fixtures/typescript/static-blocks/static-blocks-and-proptery-named-static/output.json b/packages/babel-parser/test/fixtures/typescript/static-blocks/static-blocks-and-proptery-named-static/output.json index 1fd1dd823729..a6c38e79d139 100644 --- a/packages/babel-parser/test/fixtures/typescript/static-blocks/static-blocks-and-proptery-named-static/output.json +++ b/packages/babel-parser/test/fixtures/typescript/static-blocks/static-blocks-and-proptery-named-static/output.json @@ -30,6 +30,7 @@ "name": "static" }, "computed": false, + "accessor": false, "value": null }, { diff --git a/packages/babel-parser/test/fixtures/typescript/static-blocks/static-blocks-and-static-property-named-static/output.json b/packages/babel-parser/test/fixtures/typescript/static-blocks/static-blocks-and-static-property-named-static/output.json index ffe88cead774..859860247a1d 100644 --- a/packages/babel-parser/test/fixtures/typescript/static-blocks/static-blocks-and-static-property-named-static/output.json +++ b/packages/babel-parser/test/fixtures/typescript/static-blocks/static-blocks-and-static-property-named-static/output.json @@ -30,6 +30,7 @@ "name": "static" }, "computed": false, + "accessor": false, "value": null }, { diff --git a/packages/babel-parser/test/fixtures/typescript/static-blocks/static-blocks-and-static-property/output.json b/packages/babel-parser/test/fixtures/typescript/static-blocks/static-blocks-and-static-property/output.json index 754121e53f01..acfaf857a8fb 100644 --- a/packages/babel-parser/test/fixtures/typescript/static-blocks/static-blocks-and-static-property/output.json +++ b/packages/babel-parser/test/fixtures/typescript/static-blocks/static-blocks-and-static-property/output.json @@ -30,6 +30,7 @@ "name": "foo" }, "computed": false, + "accessor": false, "value": null }, {