fixed missing errors on assignment pattern in object expression (#10607)

* 🐛 fixed missing errors on assignment pattern in object expression

* ♻️ remove a non-needed comment

* 🐛 missed adding comma in the test input

* 🐛 fixed the failing valid-property-initializer test
This commit is contained in:
Vivek Nayyar
2019-10-30 03:02:02 +05:30
committed by Nicolò Ribaudo
parent 198b4a0fbd
commit 4b3a19ea9f
7 changed files with 447 additions and 1 deletions

View File

@@ -204,7 +204,10 @@ export default class ExpressionParser extends LValParser {
node.left = this.match(tt.eq)
? this.toAssignable(left, undefined, "assignment expression")
: left;
refShorthandDefaultPos.start = 0; // reset because shorthand default was used correctly
if (refShorthandDefaultPos.start >= node.left.start) {
refShorthandDefaultPos.start = 0; // reset because shorthand default was used correctly
}
this.checkLVal(left, undefined, undefined, "assignment expression");