mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 22:38:51 +00:00
LibJS: Rewrite Parser.parse_object_expression()
This rewrite drastically increases the accuracy of object literals. Additionally, an "assertIsSyntaxError" function has been added to test-common.js to assist in testing syntax errors.
This commit is contained in:
parent
05b7fec517
commit
ab576e610c
Notes:
sideshowbarker
2024-07-19 05:55:20 +09:00
Author: https://github.com/mattco98
Commit: ab576e610c
Pull-request: https://github.com/SerenityOS/serenity/pull/2450
Issue: https://github.com/SerenityOS/serenity/issues/2359
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/linusg
Reviewed-by: https://github.com/sunverwerth
5 changed files with 138 additions and 59 deletions
|
@ -66,6 +66,17 @@ try {
|
|||
assert(a[2] === 3);
|
||||
assert(o4.test === undefined);
|
||||
|
||||
assertIsSyntaxError("({ get ...foo })");
|
||||
assertIsSyntaxError("({ get... foo })");
|
||||
assertIsSyntaxError("({ get foo })");
|
||||
assertIsSyntaxError("({ get foo: bar })");
|
||||
assertIsSyntaxError("({ get [foo]: bar })");
|
||||
assertIsSyntaxError("({ get ...[foo] })");
|
||||
assertIsSyntaxError("({ get foo(bar) {} })");
|
||||
assertIsSyntaxError("({ set foo() {} })");
|
||||
assertIsSyntaxError("({ set foo(bar, baz) {} })");
|
||||
assertIsSyntaxError("({ ...foo: bar })");
|
||||
|
||||
console.log("PASS");
|
||||
} catch (e) {
|
||||
console.log("FAIL: " + e);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue