mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
LibWeb: Convert the Navigator object to ThrowCompletionOr
This commit is contained in:
parent
0f93c9d6c8
commit
19ac19eae1
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue