mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-14 23:22:52 +00:00
LibJS: Implement computed properties in object expressions
This commit is contained in:
parent
bebd5c097c
commit
746dd5b190
Notes:
sideshowbarker
2024-07-19 07:20:58 +09:00
Author: https://github.com/linusg
Commit: 746dd5b190
Pull-request: https://github.com/SerenityOS/serenity/pull/1932
Reviewed-by: https://github.com/awesomekling
5 changed files with 98 additions and 19 deletions
|
@ -1,7 +1,10 @@
|
|||
const a = 1;
|
||||
const object = {a, b: 2};
|
||||
const computedKey = "d";
|
||||
const object = {a, b: 2, "c": 3, [computedKey]: 2 + 2};
|
||||
const emptyObject = {};
|
||||
|
||||
console.log(object.a);
|
||||
console.log(object.b);
|
||||
console.log(object.c);
|
||||
console.log(object.d);
|
||||
console.log(emptyObject.foo);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue