mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-10 19:46:03 +00:00
LibJS: Support computed member expressions in nullish object exceptions
This commit is contained in:
parent
51f5fa1437
commit
2d603c7c3f
Notes:
sideshowbarker
2024-07-16 23:51:07 +09:00
Author: https://github.com/trflynn89
Commit: 2d603c7c3f
Pull-request: https://github.com/SerenityOS/serenity/pull/23802
2 changed files with 19 additions and 3 deletions
|
@ -461,9 +461,10 @@ static Optional<ByteString> expression_identifier(Expression const& expression)
|
|||
builder.append(*identifer);
|
||||
|
||||
if (auto identifer = expression_identifier(member_expression.property()); identifer.has_value()) {
|
||||
if (!builder.is_empty())
|
||||
builder.append('.');
|
||||
builder.append(*identifer);
|
||||
if (member_expression.is_computed())
|
||||
builder.appendff("[{}]", *identifer);
|
||||
else
|
||||
builder.appendff(".{}", *identifer);
|
||||
}
|
||||
|
||||
return builder.to_byte_string();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue