Remove parenthesizedArgument (#7981)

The extra field parenthesizedArgument was never set to true. It was
always set to false and the code that read this was incorrectly
checking if extra was present.

Fixes #7957
This commit is contained in:
Erik Arvidsson 2018-05-29 13:58:21 -07:00 committed by Logan Smyth
parent 9add6d88f5
commit 2a8ebbe7ae
65 changed files with 14 additions and 254 deletions

View File

@ -287,9 +287,7 @@ export default class ExpressionParser extends LValParser {
if (
operator === "**" &&
left.type === "UnaryExpression" &&
left.extra &&
!left.extra.parenthesizedArgument &&
!left.extra.parenthesized
!(left.extra && left.extra.parenthesized)
) {
this.raise(
left.argument.start,
@ -364,16 +362,8 @@ export default class ExpressionParser extends LValParser {
}
this.next();
const argType = this.state.type;
node.argument = this.parseMaybeUnary();
this.addExtra(
node,
"parenthesizedArgument",
argType === tt.parenL &&
(!node.argument.extra || !node.argument.extra.parenthesized),
);
if (refShorthandDefaultPos && refShorthandDefaultPos.start) {
this.unexpected(refShorthandDefaultPos.start);
}

View File

@ -30,8 +30,5 @@
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -30,8 +30,5 @@
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -30,8 +30,5 @@
"identifierName": "eval"
},
"name": "eval"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -30,8 +30,5 @@
"identifierName": "eval"
},
"name": "eval"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -30,8 +30,5 @@
"identifierName": "arguments"
},
"name": "arguments"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -30,8 +30,5 @@
"identifierName": "arguments"
},
"name": "arguments"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -30,8 +30,5 @@
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -30,8 +30,5 @@
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -30,8 +30,5 @@
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -30,8 +30,5 @@
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -30,8 +30,5 @@
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -30,8 +30,5 @@
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -30,8 +30,5 @@
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -138,9 +138,6 @@
"body": [],
"directives": []
}
},
"extra": {
"parenthesizedArgument": false
}
},
"operator": "/",

View File

@ -75,9 +75,6 @@
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -75,9 +75,6 @@
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -75,9 +75,6 @@
"identifierName": "eval"
},
"name": "eval"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -75,9 +75,6 @@
"identifierName": "eval"
},
"name": "eval"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -75,9 +75,6 @@
"identifierName": "arguments"
},
"name": "arguments"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -75,9 +75,6 @@
"identifierName": "arguments"
},
"name": "arguments"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -75,9 +75,6 @@
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -75,9 +75,6 @@
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -75,9 +75,6 @@
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -75,9 +75,6 @@
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -75,9 +75,6 @@
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -75,9 +75,6 @@
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -75,9 +75,6 @@
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -122,9 +122,6 @@
"identifierName": "y"
},
"name": "y"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -122,9 +122,6 @@
"identifierName": "y"
},
"name": "y"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -88,9 +88,6 @@
}
},
"properties": []
},
"extra": {
"parenthesizedArgument": false
}
},
"operator": "/",

View File

@ -106,9 +106,6 @@
},
"name": "x"
}
},
"extra": {
"parenthesizedArgument": false
}
},
"operator": "/",

View File

@ -327,9 +327,6 @@
"identifierName": "effects"
},
"name": "effects"
},
"extra": {
"parenthesizedArgument": false
}
},
{
@ -367,9 +364,6 @@
"raw": "1"
},
"value": 1
},
"extra": {
"parenthesizedArgument": false
}
}
],
@ -692,9 +686,6 @@
"identifierName": "iterations"
},
"name": "iterations"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -123,13 +123,7 @@
"identifierName": "bar"
},
"name": "bar"
},
"extra": {
"parenthesizedArgument": false
}
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -110,9 +110,6 @@
"body": [],
"directives": []
}
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -118,9 +118,6 @@
"parenthesized": true,
"parenStart": 1
}
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -127,9 +127,6 @@
"raw": "1"
},
"value": 1
},
"extra": {
"parenthesizedArgument": false
}
},
"extra": {

View File

@ -127,9 +127,6 @@
"raw": "1"
},
"value": 1
},
"extra": {
"parenthesizedArgument": false
}
}
},

View File

@ -94,7 +94,6 @@
"value": 5
},
"extra": {
"parenthesizedArgument": false,
"parenthesized": true,
"parenStart": 0
}

View File

@ -122,9 +122,6 @@
"identifierName": "y"
},
"name": "y"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -122,9 +122,6 @@
"identifierName": "y"
},
"name": "y"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -75,9 +75,6 @@
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -75,9 +75,6 @@
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -75,9 +75,6 @@
"identifierName": "eval"
},
"name": "eval"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -75,9 +75,6 @@
"identifierName": "eval"
},
"name": "eval"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -75,9 +75,6 @@
"identifierName": "arguments"
},
"name": "arguments"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -75,9 +75,6 @@
"identifierName": "arguments"
},
"name": "arguments"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -75,9 +75,6 @@
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -75,9 +75,6 @@
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -75,9 +75,6 @@
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -75,9 +75,6 @@
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -75,9 +75,6 @@
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -75,9 +75,6 @@
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -75,9 +75,6 @@
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -386,9 +386,6 @@
"name": "EOF"
},
"computed": false
},
"extra": {
"parenthesizedArgument": false
}
},
"body": {

View File

@ -494,9 +494,6 @@
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
}
}
@ -625,9 +622,6 @@
"identifierName": "y"
},
"name": "y"
},
"extra": {
"parenthesizedArgument": false
}
}
}
@ -1158,9 +1152,6 @@
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
}
}
@ -1289,9 +1280,6 @@
"identifierName": "y"
},
"name": "y"
},
"extra": {
"parenthesizedArgument": false
}
}
}
@ -1630,9 +1618,6 @@
"identifierName": "value"
},
"name": "value"
},
"extra": {
"parenthesizedArgument": false
}
}
}
@ -1971,9 +1956,6 @@
"identifierName": "value"
},
"name": "value"
},
"extra": {
"parenthesizedArgument": false
}
}
}
@ -2992,9 +2974,6 @@
"identifierName": "value"
},
"name": "value"
},
"extra": {
"parenthesizedArgument": false
}
}
}
@ -3333,9 +3312,6 @@
"identifierName": "value"
},
"name": "value"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -494,9 +494,6 @@
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
}
}
@ -625,9 +622,6 @@
"identifierName": "y"
},
"name": "y"
},
"extra": {
"parenthesizedArgument": false
}
}
}
@ -966,9 +960,6 @@
"identifierName": "value"
},
"name": "value"
},
"extra": {
"parenthesizedArgument": false
}
}
}
@ -1307,9 +1298,6 @@
"identifierName": "value"
},
"name": "value"
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -142,9 +142,6 @@
"raw": "1"
},
"value": 1
},
"extra": {
"parenthesizedArgument": false
}
},
{

View File

@ -129,7 +129,6 @@
"value": 1
},
"extra": {
"parenthesizedArgument": false,
"parenthesized": true,
"parenStart": 20
}

View File

@ -158,9 +158,6 @@
"raw": "1"
},
"value": 1
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -203,9 +203,6 @@
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
},
"operator": "===",

View File

@ -202,9 +202,6 @@
"identifierName": "x"
},
"name": "x"
},
"extra": {
"parenthesizedArgument": false
}
},
"operator": "===",

View File

@ -5647,13 +5647,7 @@
"identifierName": "p"
},
"name": "p"
},
"extra": {
"parenthesizedArgument": false
}
},
"extra": {
"parenthesizedArgument": false
}
},
"consequent": {

View File

@ -286,9 +286,6 @@
"raw": "1"
},
"value": 1
},
"extra": {
"parenthesizedArgument": false
}
}
}

View File

@ -107,9 +107,6 @@
"identifierName": "b"
},
"name": "b"
},
"extra": {
"parenthesizedArgument": false
}
}
}