summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2020-05-19 21:47:15 +0100
committerAndreas Kling <kling@serenityos.org>2020-05-20 08:30:22 +0200
commiteb0810bf1acb810fa82ffc24cf853162c7822ea0 (patch)
tree21c3bddde34b94fb5859570434db6200c7406836
parent6caacfec85cf0c2f0d55e734d8e1cf034926c9cb (diff)
downloadserenity-eb0810bf1acb810fa82ffc24cf853162c7822ea0.zip
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.
-rw-r--r--Libraries/LibWeb/Bindings/LocationObject.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/Libraries/LibWeb/Bindings/LocationObject.cpp b/Libraries/LibWeb/Bindings/LocationObject.cpp
index 831bd5df08..cfdbdc2067 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);
}