diff options
author | Andreas Kling <kling@serenityos.org> | 2020-06-08 12:25:45 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-06-08 12:25:45 +0200 |
commit | affc479e83c66270812876f1537b36c324828a64 (patch) | |
tree | 58e909557f844fba4bf803da641ba7cf31c969b4 /Libraries/LibJS/Runtime/DateConstructor.cpp | |
parent | ff8bb962b620874668b797a1ee1c25de3f5c1074 (diff) | |
download | serenity-affc479e83c66270812876f1537b36c324828a64.zip |
LibJS+LibWeb: Remove a bunch of calls to Interpreter::global_object()
Objects should get the GlobalObject from themselves instead. However,
it's not yet available during construction so this only switches code
that happens after construction.
To support multiple global objects, Interpreter needs to stop holding
on to "the" global object and let each object graph own their global.
Diffstat (limited to 'Libraries/LibJS/Runtime/DateConstructor.cpp')
-rw-r--r-- | Libraries/LibJS/Runtime/DateConstructor.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Libraries/LibJS/Runtime/DateConstructor.cpp b/Libraries/LibJS/Runtime/DateConstructor.cpp index cff912c2fa..a76db80b5e 100644 --- a/Libraries/LibJS/Runtime/DateConstructor.cpp +++ b/Libraries/LibJS/Runtime/DateConstructor.cpp @@ -55,14 +55,14 @@ Value DateConstructor::call(Interpreter& interpreter) return js_string(interpreter, static_cast<Date&>(date.as_object()).string()); } -Value DateConstructor::construct(Interpreter& interpreter) +Value DateConstructor::construct(Interpreter&) { // TODO: Support args struct timeval tv; gettimeofday(&tv, nullptr); auto datetime = Core::DateTime::now(); auto milliseconds = static_cast<u16>(tv.tv_usec / 1000); - return Date::create(interpreter.global_object(), datetime, milliseconds); + return Date::create(global_object(), datetime, milliseconds); } Value DateConstructor::now(Interpreter&) |