mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-23 04:55:15 +00:00
LibJS: Fix length of PlainDateTime.withPlainTime
withPlainTime's argument is optional, so the length of the function is actually 0.
This commit is contained in:
parent
b26b18a0bc
commit
ac67077b57
Notes:
sideshowbarker
2024-07-17 17:40:13 +09:00
Author: https://github.com/Lubrsi Commit: https://github.com/SerenityOS/serenity/commit/ac67077b57 Pull-request: https://github.com/SerenityOS/serenity/pull/15913 Reviewed-by: https://github.com/davidot
2 changed files with 3 additions and 3 deletions
|
@ -59,7 +59,7 @@ void PlainDateTimePrototype::initialize(Realm& realm)
|
|||
|
||||
u8 attr = Attribute::Writable | Attribute::Configurable;
|
||||
define_native_function(realm, vm.names.with, with, 1, attr);
|
||||
define_native_function(realm, vm.names.withPlainTime, with_plain_time, 1, attr);
|
||||
define_native_function(realm, vm.names.withPlainTime, with_plain_time, 0, attr);
|
||||
define_native_function(realm, vm.names.withPlainDate, with_plain_date, 1, attr);
|
||||
define_native_function(realm, vm.names.withCalendar, with_calendar, 1, attr);
|
||||
define_native_function(realm, vm.names.add, add, 1, attr);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
describe("correct behavior", () => {
|
||||
test("length is 1", () => {
|
||||
expect(Temporal.PlainDateTime.prototype.withPlainTime).toHaveLength(1);
|
||||
test("length is 0", () => {
|
||||
expect(Temporal.PlainDateTime.prototype.withPlainTime).toHaveLength(0);
|
||||
});
|
||||
|
||||
test("basic functionality", () => {
|
||||
|
|
Loading…
Add table
Reference in a new issue