mirror of
https://github.com/RGBCube/serenity
synced 2025-05-21 21:25:08 +00:00
LibJS: Loosen type system
This commits makes effort towards tolerating some of javascript's quirks when it comes to its type system, note that the interpreter's way of handling type coercion is still not mature at all, for example, we still have to implement NaN instead of just crashing when trying to parse a string and failing.
This commit is contained in:
parent
419d57e492
commit
4d22a142f7
9 changed files with 109 additions and 55 deletions
|
@ -36,8 +36,11 @@ public:
|
|||
virtual ~StringObject() override;
|
||||
|
||||
virtual void visit_children(Visitor&) override;
|
||||
|
||||
const PrimitiveString* primitive_string() const { return m_string; }
|
||||
virtual Value value_of() const override
|
||||
{
|
||||
return Value(m_string);
|
||||
}
|
||||
|
||||
private:
|
||||
virtual const char* class_name() const override { return "StringObject"; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue