2020-05-18 21:42:40 +02:00
/*
* Copyright ( c ) 2020 , Andreas Kling < kling @ serenityos . org >
*
2021-04-22 01:24:48 -07:00
* SPDX - License - Identifier : BSD - 2 - Clause
2020-05-18 21:42:40 +02:00
*/
# pragma once
2021-09-28 23:54:42 +01:00
# include <LibJS/Runtime/Completion.h>
2020-05-18 21:42:40 +02:00
# include <LibJS/Runtime/Object.h>
# include <LibWeb/Forward.h>
namespace Web {
namespace Bindings {
class LocationObject final : public JS : : Object {
2020-06-21 15:14:02 +02:00
JS_OBJECT ( LocationObject , JS : : Object ) ;
2020-05-18 21:42:40 +02:00
public :
2020-06-20 17:28:13 +02:00
explicit LocationObject ( JS : : GlobalObject & ) ;
2020-07-22 17:50:18 +02:00
virtual void initialize ( JS : : GlobalObject & ) override ;
2020-05-18 21:42:40 +02:00
virtual ~ LocationObject ( ) override ;
2021-09-28 23:54:42 +01:00
virtual JS : : ThrowCompletionOr < bool > internal_set_prototype_of ( Object * prototype ) override ;
2021-09-12 14:54:17 +01:00
virtual bool internal_is_extensible ( ) const override ;
virtual bool internal_prevent_extensions ( ) override ;
// FIXME: There should also be a custom [[GetPrototypeOf]], [[GetOwnProperty]], [[DefineOwnProperty]], [[Get]], [[Set]], [[Delete]] and [[OwnPropertyKeys]],
// but we don't have the infrastructure in place to implement them yet.
2020-05-18 21:42:40 +02:00
private :
2020-06-20 13:55:34 +02:00
JS_DECLARE_NATIVE_FUNCTION ( reload ) ;
2020-05-18 22:05:13 +02:00
2021-07-05 15:01:57 +03:00
JS_DECLARE_NATIVE_FUNCTION ( href_getter ) ;
JS_DECLARE_NATIVE_FUNCTION ( href_setter ) ;
JS_DECLARE_NATIVE_FUNCTION ( host_getter ) ;
JS_DECLARE_NATIVE_FUNCTION ( hostname_getter ) ;
JS_DECLARE_NATIVE_FUNCTION ( pathname_getter ) ;
JS_DECLARE_NATIVE_FUNCTION ( hash_getter ) ;
JS_DECLARE_NATIVE_FUNCTION ( search_getter ) ;
JS_DECLARE_NATIVE_FUNCTION ( protocol_getter ) ;
2021-09-18 21:44:45 +02:00
JS_DECLARE_NATIVE_FUNCTION ( port_getter ) ;
2020-05-18 21:42:40 +02:00
} ;
}
}