Skip to content

Commit

Permalink
[Babel 8] Remove optional field from MemberExpression (babel#13407)
Browse files Browse the repository at this point in the history
  • Loading branch information
danez authored Jun 3, 2021
1 parent 92bca21 commit 176bc24
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ export default declare(api => {
t.memberExpression(
t.cloneNode(receiverLVal),
node.callee.property,
false,
false,
),
),
...argsInitializers,
Expand All @@ -114,8 +112,6 @@ export default declare(api => {
t.memberExpression(
t.cloneNode(functionLVal),
t.identifier("call"),
false,
false,
),
[t.cloneNode(receiverLVal), ...args],
),
Expand Down
7 changes: 6 additions & 1 deletion packages/babel-types/src/definitions/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,12 @@ defineType("LogicalExpression", {
});

defineType("MemberExpression", {
builder: ["object", "property", "computed", "optional"],
builder: [
"object",
"property",
"computed",
...(!process.env.BABEL_TYPES_8_BREAKING ? ["optional"] : []),
],
visitor: ["object", "property"],
aliases: ["Expression", "LVal"],
fields: {
Expand Down

0 comments on commit 176bc24

Please sign in to comment.