mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-19 16:51:52 +00:00
LibJS: Allow reserved words as keys in object expressions.
This commit is contained in:
parent
0345fdcb77
commit
bf5b251684
Notes:
sideshowbarker
2024-07-19 07:29:33 +09:00
Author: https://github.com/sunverwerth
Commit: bf5b251684
Pull-request: https://github.com/SerenityOS/serenity/pull/1849
Issue: https://github.com/SerenityOS/serenity/issues/1768
5 changed files with 61 additions and 3 deletions
|
@ -23,6 +23,14 @@ try {
|
|||
// Note : this test doesn't pass yet due to floating-point literals being coerced to i32 on access
|
||||
// assert(math[3.14] === "pi");
|
||||
|
||||
// This is also allowed! Watch out for syntax errors.
|
||||
var o2 = { return: 1, yield: 1, for: 1, catch: 1, break: 1 };
|
||||
assert(o2.return === 1);
|
||||
assert(o2.yield === 1);
|
||||
assert(o2.for === 1);
|
||||
assert(o2.catch === 1);
|
||||
assert(o2.break === 1);
|
||||
|
||||
console.log("PASS");
|
||||
} catch (e) {
|
||||
console.log("FAIL: " + e);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue