diff options
author | Andreas Kling <kling@serenityos.org> | 2020-04-17 19:01:31 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-04-18 10:28:22 +0200 |
commit | 298c6062000754333f360c4e80368680a1da90e8 (patch) | |
tree | 7d4a365c1cfd1f73417e286e791ade608fa595b5 /Libraries/LibJS/Runtime/StringObject.h | |
parent | cf702a13b9c8a380923929519ce035233b1e4080 (diff) | |
download | serenity-298c6062000754333f360c4e80368680a1da90e8.zip |
LibJS: Pass prototype to StringObject constructor
Diffstat (limited to 'Libraries/LibJS/Runtime/StringObject.h')
-rw-r--r-- | Libraries/LibJS/Runtime/StringObject.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Libraries/LibJS/Runtime/StringObject.h b/Libraries/LibJS/Runtime/StringObject.h index 2f914e4246..b7efd82b7c 100644 --- a/Libraries/LibJS/Runtime/StringObject.h +++ b/Libraries/LibJS/Runtime/StringObject.h @@ -32,21 +32,24 @@ namespace JS { class StringObject : public Object { public: - explicit StringObject(PrimitiveString*); + static StringObject* create(GlobalObject&, PrimitiveString&); + + StringObject(PrimitiveString&, Object& prototype); virtual ~StringObject() override; - virtual void visit_children(Visitor&) override; - const PrimitiveString* primitive_string() const { return m_string; } + // FIXME: Return const PrimitiveString& + const PrimitiveString* primitive_string() const { return &m_string; } virtual Value value_of() const override { - return Value(m_string); + return Value(&m_string); } private: + virtual void visit_children(Visitor&) override; virtual const char* class_name() const override { return "StringObject"; } virtual bool is_string_object() const override { return true; } - PrimitiveString* m_string { nullptr }; + PrimitiveString& m_string; }; } |