1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:17:35 +00:00

LibJS: Implement the GetV() abstract operation

Like Get(), but with any value instead of an object - it's calling
ToObject() for us and passes the value to [[Get]]() as the receiver.

This will be used in GetMethod() (and a couple of other places, which
can be updated over time).

I also tried something new here: adding the three steps from the spec as
inline comments :^)
This commit is contained in:
Linus Groh 2021-06-26 19:17:28 +01:00
parent dbda5a9a4c
commit 31f5797e89
2 changed files with 18 additions and 0 deletions

View file

@ -287,6 +287,8 @@ public:
double to_integer_or_infinity(GlobalObject&) const;
bool to_boolean() const;
Value get(GlobalObject&, PropertyName const&) const;
String to_string_without_side_effects() const;
Value value_or(Value fallback) const