diff options
author | Timothy Flynn <trflynn89@pm.me> | 2021-10-31 08:35:06 -0400 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-10-31 15:48:36 +0100 |
commit | 19ac19eae1607fb98bf176d2674d4db04224aa17 (patch) | |
tree | 6d3f57a61a55e7fec1a4bf69cb3215122c46921e /Userland/Libraries/LibWeb/Bindings | |
parent | 0f93c9d6c8745f760d9dce1c3e1526bcf5fc666d (diff) | |
download | serenity-19ac19eae1607fb98bf176d2674d4db04224aa17.zip |
LibWeb: Convert the Navigator object to ThrowCompletionOr
Diffstat (limited to 'Userland/Libraries/LibWeb/Bindings')
-rw-r--r-- | Userland/Libraries/LibWeb/Bindings/NavigatorObject.cpp | 8 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/Bindings/NavigatorObject.h | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Libraries/LibWeb/Bindings/NavigatorObject.cpp b/Userland/Libraries/LibWeb/Bindings/NavigatorObject.cpp index 6f599a61bc..f75d538804 100644 --- a/Userland/Libraries/LibWeb/Bindings/NavigatorObject.cpp +++ b/Userland/Libraries/LibWeb/Bindings/NavigatorObject.cpp @@ -33,8 +33,8 @@ void NavigatorObject::initialize(JS::GlobalObject& global_object) define_direct_property("platform", js_string(heap, "SerenityOS"), attr); define_direct_property("product", js_string(heap, "Gecko"), attr); - define_old_native_accessor("userAgent", user_agent_getter, {}, JS::Attribute::Configurable | JS::Attribute::Enumerable); - define_old_native_accessor("cookieEnabled", cookie_enabled_getter, {}, JS::Attribute::Configurable | JS::Attribute::Enumerable); + define_native_accessor("userAgent", user_agent_getter, {}, JS::Attribute::Configurable | JS::Attribute::Enumerable); + define_native_accessor("cookieEnabled", cookie_enabled_getter, {}, JS::Attribute::Configurable | JS::Attribute::Enumerable); // FIXME: Reflect actual connectivity status. define_direct_property("onLine", JS::Value(true), attr); @@ -44,12 +44,12 @@ NavigatorObject::~NavigatorObject() { } -JS_DEFINE_OLD_NATIVE_FUNCTION(NavigatorObject::user_agent_getter) +JS_DEFINE_NATIVE_FUNCTION(NavigatorObject::user_agent_getter) { return JS::js_string(vm, ResourceLoader::the().user_agent()); } -JS_DEFINE_OLD_NATIVE_FUNCTION(NavigatorObject::cookie_enabled_getter) +JS_DEFINE_NATIVE_FUNCTION(NavigatorObject::cookie_enabled_getter) { // No way of disabling cookies right now :^) return JS::Value(true); diff --git a/Userland/Libraries/LibWeb/Bindings/NavigatorObject.h b/Userland/Libraries/LibWeb/Bindings/NavigatorObject.h index 807483b2d3..3125d35a40 100644 --- a/Userland/Libraries/LibWeb/Bindings/NavigatorObject.h +++ b/Userland/Libraries/LibWeb/Bindings/NavigatorObject.h @@ -21,8 +21,8 @@ public: virtual ~NavigatorObject() override; private: - JS_DECLARE_OLD_NATIVE_FUNCTION(user_agent_getter); - JS_DECLARE_OLD_NATIVE_FUNCTION(cookie_enabled_getter); + JS_DECLARE_NATIVE_FUNCTION(user_agent_getter); + JS_DECLARE_NATIVE_FUNCTION(cookie_enabled_getter); }; } |