mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:17:35 +00:00
LibJS: Make the default constructed reference invalid
Since we have the to_reference method on every expression class we must somehow communicate it did not actually return a reference. This (ab)uses the fact that property name is only invalid with the default constructor and already has is_valid().
This commit is contained in:
parent
ce3f29a135
commit
7081fb4eb0
2 changed files with 8 additions and 1 deletions
|
@ -109,6 +109,8 @@ public:
|
|||
|
||||
String to_string() const;
|
||||
|
||||
bool is_valid_reference() const { return m_name.is_valid(); }
|
||||
|
||||
private:
|
||||
void throw_reference_error(GlobalObject&) const;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue