mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:28:10 +00:00
LibWeb: Allow all Script types to be used as [[HostDefined]] values
This patch adds support for all child classes of Web::HTML::Script to be used in the [[HostDefined]] field of JS::Modules and JS::Scripts.
This commit is contained in:
parent
5a3e079deb
commit
83554526f0
4 changed files with 12 additions and 10 deletions
|
@ -8,12 +8,15 @@
|
|||
|
||||
#include <AK/URL.h>
|
||||
#include <LibJS/Heap/Cell.h>
|
||||
#include <LibJS/Script.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#concept-script
|
||||
class Script : public JS::Cell {
|
||||
class Script
|
||||
: public JS::Cell
|
||||
, public JS::Script::HostDefined {
|
||||
JS_CELL(Script, JS::Cell);
|
||||
|
||||
public:
|
||||
|
@ -28,6 +31,8 @@ protected:
|
|||
Script(AK::URL base_url, String filename, EnvironmentSettingsObject& environment_settings_object);
|
||||
|
||||
private:
|
||||
virtual void visit_host_defined_self(JS::Cell::Visitor&) override;
|
||||
|
||||
AK::URL m_base_url;
|
||||
String m_filename;
|
||||
EnvironmentSettingsObject& m_settings_object;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue