diff options
author | Linus Groh <mail@linusgroh.de> | 2022-08-22 11:48:08 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-08-23 13:58:30 +0100 |
commit | b465f46e009164b5d2659f216b9307efee187222 (patch) | |
tree | 33038f3bc2c9d2d7e29c67bdfa94f38b2f761013 /Userland/Libraries/LibJS/Runtime/DateConstructor.cpp | |
parent | 7b990c27a14eddd152932d8540afc8c3838030fb (diff) | |
download | serenity-b465f46e009164b5d2659f216b9307efee187222.zip |
LibJS: Remove GlobalObject parameter from native functions
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/DateConstructor.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/DateConstructor.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp b/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp index 3222ef78fe..7fd53f1810 100644 --- a/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp @@ -198,7 +198,6 @@ ThrowCompletionOr<Value> DateConstructor::call() ThrowCompletionOr<Object*> DateConstructor::construct(FunctionObject& new_target) { auto& vm = this->vm(); - auto& global_object = this->global_object(); double date_value; @@ -249,7 +248,7 @@ ThrowCompletionOr<Object*> DateConstructor::construct(FunctionObject& new_target // c. Let m be ? ToNumber(values[1]). auto month = TRY(vm.argument(1).to_number(vm)).as_double(); - auto arg_or = [&vm, &global_object](size_t i, double fallback) -> ThrowCompletionOr<double> { + auto arg_or = [&vm](size_t i, double fallback) -> ThrowCompletionOr<double> { return vm.argument_count() > i ? TRY(vm.argument(i).to_number(vm)).as_double() : fallback; }; @@ -312,7 +311,7 @@ JS_DEFINE_NATIVE_FUNCTION(DateConstructor::parse) // 21.4.3.4 Date.UTC ( year [ , month [ , date [ , hours [ , minutes [ , seconds [ , ms ] ] ] ] ] ] ), https://tc39.es/ecma262/#sec-date.utc JS_DEFINE_NATIVE_FUNCTION(DateConstructor::utc) { - auto arg_or = [&vm, &global_object](size_t i, double fallback) -> ThrowCompletionOr<double> { + auto arg_or = [&vm](size_t i, double fallback) -> ThrowCompletionOr<double> { return vm.argument_count() > i ? TRY(vm.argument(i).to_number(vm)).as_double() : fallback; }; |