Merge pull request #12759 from asgerf/js/getset-in-pattern

JS: Fix parsing of 'get' or 'set' pattern with a default value
This commit is contained in:
Asger F
2023-04-11 14:03:00 +02:00
committed by GitHub
4 changed files with 538 additions and 0 deletions

View File

@@ -2069,6 +2069,7 @@ public class Parser {
pi.value = this.parseMethod(pi.isGenerator, pi.isAsync);
} else if (this.options.ecmaVersion() >= 5
&& !pi.computed
&& !pi.isPattern
&& pi.key instanceof Identifier
&& (((Identifier) pi.key).getName().equals("get")
|| ((Identifier) pi.key).getName().equals("set"))