mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-30 00:09:01 +00:00
LibJS: Implement (mostly) spec compliant version of Number.toString()
This commit is contained in:
parent
be9c2feff0
commit
d3524f47a0
Notes:
sideshowbarker
2024-07-19 00:32:16 +09:00
Author: https://github.com/sunverwerth
Commit: d3524f47a0
Pull-request: https://github.com/SerenityOS/serenity/pull/3803
Reviewed-by: https://github.com/linusg
4 changed files with 151 additions and 20 deletions
|
@ -40,10 +40,15 @@ describe("correct behavior", () => {
|
|||
});
|
||||
|
||||
test("numeric keys", () => {
|
||||
expect({0x10:true}).toBe({16:true});
|
||||
expect({0b10:true}).toBe({2:true});
|
||||
expect({0o10:true}).toBe({8:true});
|
||||
expect({.5:true}).toBe({"0.5":true});
|
||||
const hex = {0x10: "16"};
|
||||
const oct = {0o10: "8"};
|
||||
const bin = {0b10: "2"};
|
||||
const float = {.5: "0.5"};
|
||||
|
||||
expect(hex["16"]).toBe("16");
|
||||
expect(oct["8"]).toBe("8");
|
||||
expect(bin["2"]).toBe("2");
|
||||
expect(float["0.5"]).toBe("0.5");
|
||||
});
|
||||
|
||||
test("computed properties", () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue