destructuring private fields with array pattern / object patte… (#10017)

* destructuring private fields with array pattern / object pattern

* wip: new test cases

* destrucuring and rest for private properties

* test case for loose private-loose

* add transform-desturcturing for exec

* update test case

* remove getPrototypeOf imports from get and set

* wip: destructure super assignment

* throw "Destructuring to a super field is not supported yet."

* fix tests and fix assignment pattern

* remove CallExpression from AssignmentPattern
This commit is contained in:
Tan Li Hau
2019-07-15 07:00:20 +08:00
committed by Nicolò Ribaudo
parent 7f47cb65d0
commit d3fe22f0e1
88 changed files with 970 additions and 4 deletions

View File

@@ -20,7 +20,12 @@ defineType("AssignmentPattern", {
fields: {
...patternLikeCommon,
left: {
validate: assertNodeType("Identifier", "ObjectPattern", "ArrayPattern"),
validate: assertNodeType(
"Identifier",
"ObjectPattern",
"ArrayPattern",
"MemberExpression",
),
},
right: {
validate: assertNodeType("Expression"),