diff options
author | Linus Groh <mail@linusgroh.de> | 2022-08-21 14:00:56 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-08-23 13:58:30 +0100 |
commit | a022e548b808df91c471cb55f0245e15957e89c4 (patch) | |
tree | d6a7d452eae1d06e537a2fd77348ecaab278614f /Userland/Libraries/LibWeb/Bindings | |
parent | f6c4a0f5d00a6a03a5165f1618516acb320f13a4 (diff) | |
download | serenity-a022e548b808df91c471cb55f0245e15957e89c4.zip |
LibJS: Replace GlobalObject with VM in Value AOs [Part 4/19]
This is where the fun begins. :^)
Diffstat (limited to 'Userland/Libraries/LibWeb/Bindings')
7 files changed, 57 insertions, 49 deletions
diff --git a/Userland/Libraries/LibWeb/Bindings/AudioConstructor.cpp b/Userland/Libraries/LibWeb/Bindings/AudioConstructor.cpp index 58c65dce33..c2213231e6 100644 --- a/Userland/Libraries/LibWeb/Bindings/AudioConstructor.cpp +++ b/Userland/Libraries/LibWeb/Bindings/AudioConstructor.cpp @@ -37,6 +37,8 @@ JS::ThrowCompletionOr<JS::Value> AudioConstructor::call() // https://html.spec.whatwg.org/multipage/media.html#dom-audio JS::ThrowCompletionOr<JS::Object*> AudioConstructor::construct(FunctionObject&) { + auto& vm = this->vm(); + // 1. Let document be the current global object's associated Document. auto& window = static_cast<WindowObject&>(HTML::current_global_object()); auto& document = window.impl().associated_document(); @@ -47,12 +49,12 @@ JS::ThrowCompletionOr<JS::Object*> AudioConstructor::construct(FunctionObject&) // 3. Set an attribute value for audio using "preload" and "auto". audio->set_attribute(HTML::AttributeNames::preload, "auto"sv); - auto src_value = vm().argument(0); + auto src_value = vm.argument(0); // 4. If src is given, then set an attribute value for audio using "src" and src. // (This will cause the user agent to invoke the object's resource selection algorithm before returning.) if (!src_value.is_undefined()) { - auto src = TRY(src_value.to_string(global_object())); + auto src = TRY(src_value.to_string(vm)); audio->set_attribute(HTML::AttributeNames::src, move(src)); } diff --git a/Userland/Libraries/LibWeb/Bindings/CSSNamespace.cpp b/Userland/Libraries/LibWeb/Bindings/CSSNamespace.cpp index 9fda7fe77b..bc62558690 100644 --- a/Userland/Libraries/LibWeb/Bindings/CSSNamespace.cpp +++ b/Userland/Libraries/LibWeb/Bindings/CSSNamespace.cpp @@ -32,7 +32,7 @@ JS_DEFINE_NATIVE_FUNCTION(CSSNamespace::escape) if (!vm.argument_count()) return vm.throw_completion<JS::TypeError>(JS::ErrorType::BadArgCountAtLeastOne, "CSS.escape"); - auto identifier = TRY(vm.argument(0).to_string(global_object)); + auto identifier = TRY(vm.argument(0).to_string(vm)); return JS::js_string(vm, Web::CSS::serialize_an_identifier(identifier)); } @@ -44,13 +44,13 @@ JS_DEFINE_NATIVE_FUNCTION(CSSNamespace::supports) if (vm.argument_count() >= 2) { // When the supports(property, value) method is invoked with two arguments property and value: - auto property_name = TRY(vm.argument(0).to_string(global_object)); + auto property_name = TRY(vm.argument(0).to_string(vm)); // If property is an ASCII case-insensitive match for any defined CSS property that the UA supports, // and value successfully parses according to that property’s grammar, return true. auto property = CSS::property_id_from_string(property_name); if (property != CSS::PropertyID::Invalid) { - auto value_string = TRY(vm.argument(1).to_string(global_object)); + auto value_string = TRY(vm.argument(1).to_string(vm)); if (parse_css_value({}, value_string, property)) return JS::Value(true); } @@ -64,7 +64,7 @@ JS_DEFINE_NATIVE_FUNCTION(CSSNamespace::supports) return JS::Value(false); } else { // When the supports(conditionText) method is invoked with a single conditionText argument: - auto supports_text = TRY(vm.argument(0).to_string(global_object)); + auto supports_text = TRY(vm.argument(0).to_string(vm)); // If conditionText, parsed and evaluated as a <supports-condition>, would return true, return true. if (auto supports = parse_css_supports({}, supports_text); supports && supports->matches()) diff --git a/Userland/Libraries/LibWeb/Bindings/CSSStyleDeclarationWrapperCustom.cpp b/Userland/Libraries/LibWeb/Bindings/CSSStyleDeclarationWrapperCustom.cpp index d1746689b4..0f7eef1aae 100644 --- a/Userland/Libraries/LibWeb/Bindings/CSSStyleDeclarationWrapperCustom.cpp +++ b/Userland/Libraries/LibWeb/Bindings/CSSStyleDeclarationWrapperCustom.cpp @@ -48,11 +48,12 @@ JS::ThrowCompletionOr<bool> CSSStyleDeclarationWrapper::internal_set(JS::Propert { if (!name.is_string()) return Base::internal_set(name, value, receiver); + auto& vm = this->vm(); auto property_id = property_id_from_name(name.to_string()); if (property_id == CSS::PropertyID::Invalid) return Base::internal_set(name, value, receiver); - auto css_text = TRY(value.to_string(global_object())); + auto css_text = TRY(value.to_string(vm)); impl().set_property(property_id, css_text); return true; diff --git a/Userland/Libraries/LibWeb/Bindings/ImageConstructor.cpp b/Userland/Libraries/LibWeb/Bindings/ImageConstructor.cpp index 105af8a6d9..68e7c8498e 100644 --- a/Userland/Libraries/LibWeb/Bindings/ImageConstructor.cpp +++ b/Userland/Libraries/LibWeb/Bindings/ImageConstructor.cpp @@ -37,6 +37,8 @@ JS::ThrowCompletionOr<JS::Value> ImageConstructor::call() // https://html.spec.whatwg.org/multipage/embedded-content.html#dom-image JS::ThrowCompletionOr<JS::Object*> ImageConstructor::construct(FunctionObject&) { + auto& vm = this->vm(); + // 1. Let document be the current global object's associated Document. auto& window = static_cast<WindowObject&>(HTML::current_global_object()); auto& document = window.impl().associated_document(); @@ -45,14 +47,14 @@ JS::ThrowCompletionOr<JS::Object*> ImageConstructor::construct(FunctionObject&) auto image_element = DOM::create_element(document, HTML::TagNames::img, Namespace::HTML); // 3. If width is given, then set an attribute value for img using "width" and width. - if (vm().argument_count() > 0) { - u32 width = TRY(vm().argument(0).to_u32(global_object())); + if (vm.argument_count() > 0) { + u32 width = TRY(vm.argument(0).to_u32(vm)); image_element->set_attribute(HTML::AttributeNames::width, String::formatted("{}", width)); } // 4. If height is given, then set an attribute value for img using "height" and height. - if (vm().argument_count() > 1) { - u32 height = TRY(vm().argument(1).to_u32(global_object())); + if (vm.argument_count() > 1) { + u32 height = TRY(vm.argument(1).to_u32(vm)); image_element->set_attribute(HTML::AttributeNames::height, String::formatted("{}", height)); } diff --git a/Userland/Libraries/LibWeb/Bindings/LocationObject.cpp b/Userland/Libraries/LibWeb/Bindings/LocationObject.cpp index 4ee673ea5c..9bc06c81d6 100644 --- a/Userland/Libraries/LibWeb/Bindings/LocationObject.cpp +++ b/Userland/Libraries/LibWeb/Bindings/LocationObject.cpp @@ -100,7 +100,7 @@ JS_DEFINE_NATIVE_FUNCTION(LocationObject::href_setter) // FIXME: 1. If this's relevant Document is null, then return. // 2. Parse the given value relative to the entry settings object. If that failed, throw a TypeError exception. - auto new_href = TRY(vm.argument(0).to_string(global_object)); + auto new_href = TRY(vm.argument(0).to_string(vm)); auto href_url = window.impl().associated_document().parse_url(new_href); if (!href_url.is_valid()) return vm.throw_completion<JS::URIError>(String::formatted("Invalid URL '{}'", new_href)); @@ -227,7 +227,7 @@ JS_DEFINE_NATIVE_FUNCTION(LocationObject::reload) JS_DEFINE_NATIVE_FUNCTION(LocationObject::replace) { auto& window = static_cast<WindowObject&>(global_object); - auto url = TRY(vm.argument(0).to_string(global_object)); + auto url = TRY(vm.argument(0).to_string(vm)); // FIXME: This needs spec compliance work. window.impl().did_call_location_replace({}, move(url)); return JS::js_undefined(); diff --git a/Userland/Libraries/LibWeb/Bindings/OptionConstructor.cpp b/Userland/Libraries/LibWeb/Bindings/OptionConstructor.cpp index 47c45376ef..a00911c09e 100644 --- a/Userland/Libraries/LibWeb/Bindings/OptionConstructor.cpp +++ b/Userland/Libraries/LibWeb/Bindings/OptionConstructor.cpp @@ -38,6 +38,8 @@ JS::ThrowCompletionOr<JS::Value> OptionConstructor::call() // https://html.spec.whatwg.org/multipage/form-elements.html#dom-option JS::ThrowCompletionOr<JS::Object*> OptionConstructor::construct(FunctionObject&) { + auto& vm = this->vm(); + // 1. Let document be the current global object's associated Document. auto& window = static_cast<WindowObject&>(HTML::current_global_object()); auto& document = window.impl().associated_document(); @@ -46,8 +48,8 @@ JS::ThrowCompletionOr<JS::Object*> OptionConstructor::construct(FunctionObject&) auto option_element = static_ptr_cast<HTML::HTMLOptionElement>(DOM::create_element(document, HTML::TagNames::option, Namespace::HTML)); // 3. If text is not the empty string, then append to option a new Text node whose data is text. - if (vm().argument_count() > 0) { - auto text = TRY(vm().argument(0).to_string(global_object())); + if (vm.argument_count() > 0) { + auto text = TRY(vm.argument(0).to_string(vm)); if (!text.is_empty()) { auto new_text_node = adopt_ref(*new DOM::Text(document, text)); option_element->append_child(new_text_node); @@ -55,21 +57,21 @@ JS::ThrowCompletionOr<JS::Object*> OptionConstructor::construct(FunctionObject&) } // 4. If value is given, then set an attribute value for option using "value" and value. - if (vm().argument_count() > 1) { - auto value = TRY(vm().argument(1).to_string(global_object())); + if (vm.argument_count() > 1) { + auto value = TRY(vm.argument(1).to_string(vm)); option_element->set_attribute(HTML::AttributeNames::value, value); } // 5. If defaultSelected is true, then set an attribute value for option using "selected" and the empty string. - if (vm().argument_count() > 2) { - auto default_selected = vm().argument(2).to_boolean(); + if (vm.argument_count() > 2) { + auto default_selected = vm.argument(2).to_boolean(); if (default_selected) { option_element->set_attribute(HTML::AttributeNames::selected, ""); } } // 6. If selected is true, then set option's selectedness to true; otherwise set its selectedness to false (even if defaultSelected is true). - option_element->m_selected = vm().argument(3).to_boolean(); + option_element->m_selected = vm.argument(3).to_boolean(); // 7. Return option. return wrap(global_object(), option_element); diff --git a/Userland/Libraries/LibWeb/Bindings/WindowObject.cpp b/Userland/Libraries/LibWeb/Bindings/WindowObject.cpp index a528a91dc8..12df07e316 100644 --- a/Userland/Libraries/LibWeb/Bindings/WindowObject.cpp +++ b/Userland/Libraries/LibWeb/Bindings/WindowObject.cpp @@ -184,7 +184,7 @@ static JS::ThrowCompletionOr<HTML::Window*> impl_from(JS::VM& vm, JS::GlobalObje if (this_value.is_nullish()) this_value = &global_object; - auto* this_object = MUST(this_value.to_object(global_object)); + auto* this_object = MUST(this_value.to_object(vm)); if (!is<WindowObject>(*this_object)) return vm.throw_completion<JS::TypeError>(JS::ErrorType::NotAnObjectOfType, "WindowObject"); @@ -200,7 +200,7 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::alert) auto* impl = TRY(impl_from(vm, global_object)); String message = ""; if (vm.argument_count()) - message = TRY(vm.argument(0).to_string(global_object)); + message = TRY(vm.argument(0).to_string(vm)); impl->alert(message); return JS::js_undefined(); } @@ -210,7 +210,7 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::confirm) auto* impl = TRY(impl_from(vm, global_object)); String message = ""; if (!vm.argument(0).is_undefined()) - message = TRY(vm.argument(0).to_string(global_object)); + message = TRY(vm.argument(0).to_string(vm)); return JS::Value(impl->confirm(message)); } @@ -220,9 +220,9 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::prompt) String message = ""; String default_ = ""; if (!vm.argument(0).is_undefined()) - message = TRY(vm.argument(0).to_string(global_object)); + message = TRY(vm.argument(0).to_string(vm)); if (!vm.argument(1).is_undefined()) - default_ = TRY(vm.argument(1).to_string(global_object)); + default_ = TRY(vm.argument(1).to_string(vm)); auto response = impl->prompt(message, default_); if (response.is_null()) return JS::js_null(); @@ -231,9 +231,10 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::prompt) static JS::ThrowCompletionOr<TimerHandler> make_timer_handler(JS::GlobalObject& global_object, JS::Value handler) { + auto& vm = global_object.vm(); if (handler.is_function()) return Bindings::CallbackType(JS::make_handle<JS::Object>(handler.as_function()), HTML::incumbent_settings_object()); - return TRY(handler.to_string(global_object)); + return TRY(handler.to_string(vm)); } // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout @@ -248,7 +249,7 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::set_timeout) i32 timeout = 0; if (vm.argument_count() >= 2) - timeout = TRY(vm.argument(1).to_i32(global_object)); + timeout = TRY(vm.argument(1).to_i32(vm)); JS::MarkedVector<JS::Value> arguments { vm.heap() }; for (size_t i = 2; i < vm.argument_count(); ++i) @@ -270,7 +271,7 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::set_interval) i32 timeout = 0; if (vm.argument_count() >= 2) - timeout = TRY(vm.argument(1).to_i32(global_object)); + timeout = TRY(vm.argument(1).to_i32(vm)); JS::MarkedVector<JS::Value> arguments { vm.heap() }; for (size_t i = 2; i < vm.argument_count(); ++i) @@ -287,7 +288,7 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::clear_timeout) i32 id = 0; if (vm.argument_count()) - id = TRY(vm.argument(0).to_i32(global_object)); + id = TRY(vm.argument(0).to_i32(vm)); impl->clear_timeout(id); return JS::js_undefined(); @@ -300,7 +301,7 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::clear_interval) i32 id = 0; if (vm.argument_count()) - id = TRY(vm.argument(0).to_i32(global_object)); + id = TRY(vm.argument(0).to_i32(vm)); impl->clear_interval(id); return JS::js_undefined(); @@ -311,7 +312,7 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::request_animation_frame) auto* impl = TRY(impl_from(vm, global_object)); if (!vm.argument_count()) return vm.throw_completion<JS::TypeError>(JS::ErrorType::BadArgCountOne, "requestAnimationFrame"); - auto* callback_object = TRY(vm.argument(0).to_object(global_object)); + auto* callback_object = TRY(vm.argument(0).to_object(vm)); if (!callback_object->is_function()) return vm.throw_completion<JS::TypeError>(JS::ErrorType::NotAFunctionNoParam); NonnullOwnPtr<Bindings::CallbackType> callback = adopt_own(*new Bindings::CallbackType(JS::make_handle(callback_object), HTML::incumbent_settings_object())); @@ -323,7 +324,7 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::cancel_animation_frame) auto* impl = TRY(impl_from(vm, global_object)); if (!vm.argument_count()) return vm.throw_completion<JS::TypeError>(JS::ErrorType::BadArgCountOne, "cancelAnimationFrame"); - auto id = TRY(vm.argument(0).to_i32(global_object)); + auto id = TRY(vm.argument(0).to_i32(vm)); impl->cancel_animation_frame(id); return JS::js_undefined(); } @@ -333,7 +334,7 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::queue_microtask) auto* impl = TRY(impl_from(vm, global_object)); if (!vm.argument_count()) return vm.throw_completion<JS::TypeError>(JS::ErrorType::BadArgCountAtLeastOne, "queueMicrotask"); - auto* callback_object = TRY(vm.argument(0).to_object(global_object)); + auto* callback_object = TRY(vm.argument(0).to_object(vm)); if (!callback_object->is_function()) return vm.throw_completion<JS::TypeError>(JS::ErrorType::NotAFunctionNoParam); @@ -348,7 +349,7 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::request_idle_callback) auto* impl = TRY(impl_from(vm, global_object)); if (!vm.argument_count()) return vm.throw_completion<JS::TypeError>(JS::ErrorType::BadArgCountAtLeastOne, "requestIdleCallback"); - auto* callback_object = TRY(vm.argument(0).to_object(global_object)); + auto* callback_object = TRY(vm.argument(0).to_object(vm)); if (!callback_object->is_function()) return vm.throw_completion<JS::TypeError>(JS::ErrorType::NotAFunctionNoParam); // FIXME: accept options object @@ -363,7 +364,7 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::cancel_idle_callback) auto* impl = TRY(impl_from(vm, global_object)); if (!vm.argument_count()) return vm.throw_completion<JS::TypeError>(JS::ErrorType::BadArgCountOne, "cancelIdleCallback"); - auto id = TRY(vm.argument(0).to_u32(global_object)); + auto id = TRY(vm.argument(0).to_u32(vm)); impl->cancel_idle_callback(id); return JS::js_undefined(); } @@ -372,7 +373,7 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::atob) { if (!vm.argument_count()) return vm.throw_completion<JS::TypeError>(JS::ErrorType::BadArgCountOne, "atob"); - auto string = TRY(vm.argument(0).to_string(global_object)); + auto string = TRY(vm.argument(0).to_string(vm)); auto decoded = decode_base64(StringView(string)); if (decoded.is_error()) return vm.throw_completion<JS::TypeError>(JS::ErrorType::InvalidFormat, "Base64"); @@ -387,7 +388,7 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::btoa) { if (!vm.argument_count()) return vm.throw_completion<JS::TypeError>(JS::ErrorType::BadArgCountOne, "btoa"); - auto string = TRY(vm.argument(0).to_string(global_object)); + auto string = TRY(vm.argument(0).to_string(vm)); Vector<u8> byte_string; byte_string.ensure_capacity(string.length()); @@ -515,7 +516,7 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::device_pixel_ratio_getter) JS_DEFINE_NATIVE_FUNCTION(WindowObject::get_computed_style) { auto* impl = TRY(impl_from(vm, global_object)); - auto* object = TRY(vm.argument(0).to_object(global_object)); + auto* object = TRY(vm.argument(0).to_object(vm)); if (!is<ElementWrapper>(object)) return vm.throw_completion<JS::TypeError>(JS::ErrorType::NotAnObjectOfType, "DOM element"); @@ -534,7 +535,7 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::get_selection) JS_DEFINE_NATIVE_FUNCTION(WindowObject::match_media) { auto* impl = TRY(impl_from(vm, global_object)); - auto media = TRY(vm.argument(0).to_string(global_object)); + auto media = TRY(vm.argument(0).to_string(vm)); return wrap(global_object, impl->match_media(move(media))); } @@ -579,7 +580,7 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::scroll) String behavior_string = "auto"; if (vm.argument_count() == 1) { - auto* options = TRY(vm.argument(0).to_object(global_object)); + auto* options = TRY(vm.argument(0).to_object(vm)); auto left = TRY(options->get("left")); if (!left.is_undefined()) x_value = left; @@ -590,7 +591,7 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::scroll) auto behavior_string_value = TRY(options->get("behavior")); if (!behavior_string_value.is_undefined()) - behavior_string = TRY(behavior_string_value.to_string(global_object)); + behavior_string = TRY(behavior_string_value.to_string(vm)); if (behavior_string != "smooth" && behavior_string != "auto") return vm.throw_completion<JS::TypeError>("Behavior is not one of 'smooth' or 'auto'"); @@ -602,10 +603,10 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::scroll) ScrollBehavior behavior = (behavior_string == "smooth") ? ScrollBehavior::Smooth : ScrollBehavior::Auto; - double x = TRY(x_value.to_double(global_object)); + double x = TRY(x_value.to_double(vm)); x = JS::Value(x).is_finite_number() ? x : 0.0; - double y = TRY(y_value.to_double(global_object)); + double y = TRY(y_value.to_double(vm)); y = JS::Value(y).is_finite_number() ? y : 0.0; // FIXME: Are we calculating the viewport in the way this function expects? @@ -630,7 +631,7 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::scroll_by) if (vm.argument_count() == 0) { options = JS::Object::create(realm, nullptr); } else if (vm.argument_count() == 1) { - options = TRY(vm.argument(0).to_object(global_object)); + options = TRY(vm.argument(0).to_object(vm)); } else if (vm.argument_count() >= 2) { // We ignore arguments 2+ in line with behavior of Chrome and Firefox options = JS::Object::create(realm, nullptr); @@ -640,10 +641,10 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::scroll_by) } auto left_value = TRY(options->get("left")); - auto left = TRY(left_value.to_double(global_object)); + auto left = TRY(left_value.to_double(vm)); auto top_value = TRY(options->get("top")); - auto top = TRY(top_value.to_double(global_object)); + auto top = TRY(top_value.to_double(vm)); left = JS::Value(left).is_finite_number() ? left : 0.0; top = JS::Value(top).is_finite_number() ? top : 0.0; @@ -653,7 +654,7 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::scroll_by) top = top + current_scroll_position.y(); auto behavior_string_value = TRY(options->get("behavior")); - auto behavior_string = behavior_string_value.is_undefined() ? "auto" : TRY(behavior_string_value.to_string(global_object)); + auto behavior_string = behavior_string_value.is_undefined() ? "auto" : TRY(behavior_string_value.to_string(vm)); if (behavior_string != "smooth" && behavior_string != "auto") return vm.throw_completion<JS::TypeError>("Behavior is not one of 'smooth' or 'auto'"); ScrollBehavior behavior = (behavior_string == "smooth") ? ScrollBehavior::Smooth : ScrollBehavior::Auto; @@ -698,7 +699,7 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::screen_y_getter) JS_DEFINE_NATIVE_FUNCTION(WindowObject::post_message) { auto* impl = TRY(impl_from(vm, global_object)); - auto target_origin = TRY(vm.argument(1).to_string(global_object)); + auto target_origin = TRY(vm.argument(1).to_string(vm)); impl->post_message(vm.argument(0), target_origin); return JS::js_undefined(); } @@ -733,7 +734,7 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::name_getter) JS_DEFINE_NATIVE_FUNCTION(WindowObject::name_setter) { auto* impl = TRY(impl_from(vm, global_object)); - impl->set_name(TRY(vm.argument(0).to_string(global_object))); + impl->set_name(TRY(vm.argument(0).to_string(vm))); return JS::js_undefined(); } |