JavaScript: Recognise rest patterns as lvalues.

This commit is contained in:
Max Schaefer
2018-10-24 16:36:26 +01:00
parent 394d7b7a9b
commit 34b33ca04c
3 changed files with 9 additions and 1 deletions

View File

@@ -98,7 +98,8 @@ private predicate lvalAux(Expr l, ControlFlowNode def) {
exists (ArrayPattern ap | lvalAux(ap, def) | l = ap.getAnElement().stripParens())
or
exists (ObjectPattern op | lvalAux(op, def) |
l = op.getAPropertyPattern().getValuePattern().stripParens()
l = op.getAPropertyPattern().getValuePattern().stripParens() or
l = op.getRest().stripParens()
)
}