From eb0810bf1acb810fa82ffc24cf853162c7822ea0 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Tue, 19 May 2020 21:47:15 +0100 Subject: [PATCH] LibWeb: Make window.location properties non-configurable Technically the property descriptors for these should not have "writable: true" but "get" and "set" instead - but we don't support that yet. --- Libraries/LibWeb/Bindings/LocationObject.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Libraries/LibWeb/Bindings/LocationObject.cpp b/Libraries/LibWeb/Bindings/LocationObject.cpp index 831bd5df086..cfdbdc2067a 100644 --- a/Libraries/LibWeb/Bindings/LocationObject.cpp +++ b/Libraries/LibWeb/Bindings/LocationObject.cpp @@ -38,13 +38,14 @@ namespace Bindings { LocationObject::LocationObject() : Object(interpreter().global_object().object_prototype()) { - put_native_property("href", href_getter, href_setter); - put_native_property("host", host_getter, nullptr); - put_native_property("hostname", hostname_getter, nullptr); - put_native_property("pathname", pathname_getter, nullptr); - put_native_property("hash", hash_getter, nullptr); - put_native_property("search", search_getter, nullptr); - put_native_property("protocol", protocol_getter, nullptr); + u8 attr = JS::Attribute::Writable | JS::Attribute::Enumerable; + put_native_property("href", href_getter, href_setter, attr); + put_native_property("host", host_getter, nullptr, attr); + put_native_property("hostname", hostname_getter, nullptr, attr); + put_native_property("pathname", pathname_getter, nullptr, attr); + put_native_property("hash", hash_getter, nullptr, attr); + put_native_property("search", search_getter, nullptr, attr); + put_native_property("protocol", protocol_getter, nullptr, attr); put_native_function("reload", reload); }