1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 19:38:12 +00:00

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.
This commit is contained in:
Linus Groh 2020-05-19 21:47:15 +01:00 committed by Andreas Kling
parent 6caacfec85
commit eb0810bf1a

View file

@ -38,13 +38,14 @@ namespace Bindings {
LocationObject::LocationObject() LocationObject::LocationObject()
: Object(interpreter().global_object().object_prototype()) : Object(interpreter().global_object().object_prototype())
{ {
put_native_property("href", href_getter, href_setter); u8 attr = JS::Attribute::Writable | JS::Attribute::Enumerable;
put_native_property("host", host_getter, nullptr); put_native_property("href", href_getter, href_setter, attr);
put_native_property("hostname", hostname_getter, nullptr); put_native_property("host", host_getter, nullptr, attr);
put_native_property("pathname", pathname_getter, nullptr); put_native_property("hostname", hostname_getter, nullptr, attr);
put_native_property("hash", hash_getter, nullptr); put_native_property("pathname", pathname_getter, nullptr, attr);
put_native_property("search", search_getter, nullptr); put_native_property("hash", hash_getter, nullptr, attr);
put_native_property("protocol", protocol_getter, nullptr); put_native_property("search", search_getter, nullptr, attr);
put_native_property("protocol", protocol_getter, nullptr, attr);
put_native_function("reload", reload); put_native_function("reload", reload);
} }