mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 02:29:21 +00:00
Everywhere: Hoist the Libraries folder to the top-level
This commit is contained in:
parent
950e819ee7
commit
93712b24bf
Notes:
github-actions[bot]
2024-11-10 11:51:52 +00:00
Author: https://github.com/trflynn89
Commit: 93712b24bf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
4547 changed files with 104 additions and 113 deletions
50
Libraries/LibJS/Tests/object-method-shorthand.js
Normal file
50
Libraries/LibJS/Tests/object-method-shorthand.js
Normal file
|
@ -0,0 +1,50 @@
|
|||
test("basic method shorthand", () => {
|
||||
const o = {
|
||||
foo: "bar",
|
||||
getFoo() {
|
||||
return this.foo;
|
||||
},
|
||||
};
|
||||
expect(o.getFoo()).toBe("bar");
|
||||
});
|
||||
|
||||
test("numeric literal method shorthand", () => {
|
||||
const o = {
|
||||
foo: "bar",
|
||||
12() {
|
||||
return this.foo;
|
||||
},
|
||||
};
|
||||
expect(o[12]()).toBe("bar");
|
||||
});
|
||||
|
||||
test("string literal method shorthand", () => {
|
||||
const o = {
|
||||
foo: "bar",
|
||||
"hello friends"() {
|
||||
return this.foo;
|
||||
},
|
||||
};
|
||||
expect(o["hello friends"]()).toBe("bar");
|
||||
});
|
||||
|
||||
test("computed property method shorthand", () => {
|
||||
const o = {
|
||||
foo: "bar",
|
||||
[4 + 10]() {
|
||||
return this.foo;
|
||||
},
|
||||
};
|
||||
expect(o[14]()).toBe("bar");
|
||||
});
|
||||
|
||||
test("symbol computed property shorthand", () => {
|
||||
const s = Symbol("foo");
|
||||
const o = {
|
||||
foo: "bar",
|
||||
[s]() {
|
||||
return this.foo;
|
||||
},
|
||||
};
|
||||
expect(o[s]()).toBe("bar");
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue