summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/AST.h
diff options
context:
space:
mode:
authordavidot <david.tuin@gmail.com>2021-09-18 01:11:32 +0200
committerLinus Groh <mail@linusgroh.de>2021-09-30 08:16:32 +0100
commitbfc1b4ba6185726f8b567f188a407e821892d5b1 (patch)
tree09c786930c9e41dc4b3a4e369c685886c0c48028 /Userland/Libraries/LibJS/AST.h
parent9cb570039891b88a8d75c3fae761f617c340e2b7 (diff)
downloadserenity-bfc1b4ba6185726f8b567f188a407e821892d5b1.zip
LibJS: Allow member expressions in binding patterns
Also allows literal string and numbers as property names in object binding patterns.
Diffstat (limited to 'Userland/Libraries/LibJS/AST.h')
-rw-r--r--Userland/Libraries/LibJS/AST.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/AST.h b/Userland/Libraries/LibJS/AST.h
index c9aeb8bfaf..e6954a3666 100644
--- a/Userland/Libraries/LibJS/AST.h
+++ b/Userland/Libraries/LibJS/AST.h
@@ -27,6 +27,7 @@ namespace JS {
class VariableDeclaration;
class FunctionDeclaration;
class Identifier;
+class MemberExpression;
enum class FunctionKind {
Generator,
@@ -319,7 +320,7 @@ struct BindingPattern : RefCounted<BindingPattern> {
struct BindingEntry {
// If this entry represents a BindingElement, then name will be Empty
Variant<NonnullRefPtr<Identifier>, NonnullRefPtr<Expression>, Empty> name {};
- Variant<NonnullRefPtr<Identifier>, NonnullRefPtr<BindingPattern>, Empty> alias {};
+ Variant<NonnullRefPtr<Identifier>, NonnullRefPtr<BindingPattern>, NonnullRefPtr<MemberExpression>, Empty> alias {};
RefPtr<Expression> initializer {};
bool is_rest { false };