diff options
author | Andreas Kling <kling@serenityos.org> | 2020-06-20 13:55:34 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-06-20 15:45:07 +0200 |
commit | e4add199153bd32a7a4ccbe32751c799aaacaea9 (patch) | |
tree | 5d326c1635f94eadf6d53861be17186a21865085 /Libraries/LibJS/Runtime/Uint8ClampedArray.cpp | |
parent | 4aa98052caa728da0de4c3960d312d8cf92f1be7 (diff) | |
download | serenity-e4add199153bd32a7a4ccbe32751c799aaacaea9.zip |
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.
Diffstat (limited to 'Libraries/LibJS/Runtime/Uint8ClampedArray.cpp')
-rw-r--r-- | Libraries/LibJS/Runtime/Uint8ClampedArray.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Libraries/LibJS/Runtime/Uint8ClampedArray.cpp b/Libraries/LibJS/Runtime/Uint8ClampedArray.cpp index 15ba4295e2..f9f8267718 100644 --- a/Libraries/LibJS/Runtime/Uint8ClampedArray.cpp +++ b/Libraries/LibJS/Runtime/Uint8ClampedArray.cpp @@ -53,9 +53,9 @@ Uint8ClampedArray::~Uint8ClampedArray() m_data = nullptr; } -Value Uint8ClampedArray::length_getter(Interpreter& interpreter) +JS_DEFINE_NATIVE_GETTER(Uint8ClampedArray::length_getter) { - auto* this_object = interpreter.this_value(interpreter.global_object()).to_object(interpreter); + auto* this_object = interpreter.this_value(global_object).to_object(interpreter); if (!this_object) return {}; if (StringView(this_object->class_name()) != "Uint8ClampedArray") |