summaryrefslogtreecommitdiffstats
path: root/js/src/frontend/Parser.h
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/frontend/Parser.h')
-rw-r--r--js/src/frontend/Parser.h30
1 files changed, 19 insertions, 11 deletions
diff --git a/js/src/frontend/Parser.h b/js/src/frontend/Parser.h
index b1d3bdee0..9b6387c9f 100644
--- a/js/src/frontend/Parser.h
+++ b/js/src/frontend/Parser.h
@@ -1498,17 +1498,25 @@ class Parser final : public ParserBase, private JS::AutoGCRooter
Node objectLiteral(YieldHandling yieldHandling, PossibleError* possibleError);
- // Top-level entrypoint into destructuring pattern checking/name-analyzing.
- bool checkDestructuringPattern(Node pattern, mozilla::Maybe<DeclarationKind> maybeDecl,
- PossibleError* possibleError = nullptr);
-
- // Recursive methods for checking/name-analyzing subcomponents of a
- // destructuring pattern. The array/object methods *must* be passed arrays
- // or objects. The name method may be passed anything but will report an
- // error if not passed a name.
- bool checkDestructuringArray(Node arrayPattern, mozilla::Maybe<DeclarationKind> maybeDecl);
- bool checkDestructuringObject(Node objectPattern, mozilla::Maybe<DeclarationKind> maybeDecl);
- bool checkDestructuringName(Node expr, mozilla::Maybe<DeclarationKind> maybeDecl);
+ Node bindingInitializer(Node lhs, YieldHandling yieldHandling);
+ Node bindingIdentifier(DeclarationKind kind, YieldHandling yieldHandling);
+ Node bindingIdentifierOrPattern(DeclarationKind kind, YieldHandling yieldHandling,
+ TokenKind tt);
+ Node objectBindingPattern(DeclarationKind kind, YieldHandling yieldHandling);
+ Node arrayBindingPattern(DeclarationKind kind, YieldHandling yieldHandling);
+
+ // Top-level entrypoint into destructuring assignment pattern checking and
+ // name-analyzing.
+ bool checkDestructuringAssignmentPattern(Node pattern,
+ PossibleError* possibleError = nullptr);
+
+ // Recursive methods for checking/name-analyzing subcomponents of an
+ // destructuring assignment pattern. The array/object methods *must* be
+ // passed arrays or objects. The name method may be passed anything but
+ // will report an error if not passed a name.
+ bool checkDestructuringAssignmentArray(Node arrayPattern);
+ bool checkDestructuringAssignmentObject(Node objectPattern);
+ bool checkDestructuringAssignmentName(Node expr);
Node newNumber(const Token& tok) {
return handler.newNumber(tok.number(), tok.decimalPoint(), tok.pos);