mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-09 19:16:02 +00:00
LibJS: Allow object properties called 'async'
This commit is contained in:
parent
450dedabd1
commit
32016d3924
Notes:
sideshowbarker
2024-07-17 23:19:00 +09:00
Author: https://github.com/davidot
Commit: 32016d3924
Pull-request: https://github.com/SerenityOS/serenity/pull/11088
Issue: https://github.com/SerenityOS/serenity/issues/11078
Reviewed-by: https://github.com/IdanHo
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/linusg ✅
2 changed files with 10 additions and 1 deletions
|
@ -18,6 +18,14 @@ describe("parsing object literal async functions", () => {
|
|||
expect(`x = { async
|
||||
foo() { } }`).not.toEval();
|
||||
});
|
||||
|
||||
test("property on object called async", () => {
|
||||
expect(`x = { async() { } }`).toEval();
|
||||
expect(`x = { async() { await 4; } }`).not.toEval();
|
||||
expect(`x = { async: 3 }`).toEval();
|
||||
expect(`x = { async: await 3, }`).not.toEval();
|
||||
});
|
||||
|
||||
test("await expression", () => {
|
||||
expect(`x = { foo() { await bar(); } }`).not.toEval();
|
||||
expect(`x = { foo() { await; } }`).toEval();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue