mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:57:47 +00:00
LibJS: Allow member expressions in binding patterns
Also allows literal string and numbers as property names in object binding patterns.
This commit is contained in:
parent
9cb5700398
commit
bfc1b4ba61
6 changed files with 177 additions and 77 deletions
|
@ -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 };
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue