From e4add199153bd32a7a4ccbe32751c799aaacaea9 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 20 Jun 2020 13:55:34 +0200 Subject: LibJS: Pass GlobalObject& to native functions and property accessors More work towards supporting multiple global objects. Native C++ code now get a GlobalObject& and don't have to ask the Interpreter for it. I've added macros for declaring and defining native callbacks since this was pretty tedious and this makes it easier next time we want to change any of these signatures. --- Libraries/LibJS/Runtime/DateConstructor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Libraries/LibJS/Runtime/DateConstructor.cpp') diff --git a/Libraries/LibJS/Runtime/DateConstructor.cpp b/Libraries/LibJS/Runtime/DateConstructor.cpp index a76db80b5e..d00b1e6323 100644 --- a/Libraries/LibJS/Runtime/DateConstructor.cpp +++ b/Libraries/LibJS/Runtime/DateConstructor.cpp @@ -65,7 +65,7 @@ Value DateConstructor::construct(Interpreter&) return Date::create(global_object(), datetime, milliseconds); } -Value DateConstructor::now(Interpreter&) +JS_DEFINE_NATIVE_FUNCTION(DateConstructor::now) { struct timeval tv; gettimeofday(&tv, nullptr); -- cgit v1.2.3