Open
Description
Currently, a PropertyLValue can only be converted into Value via the type convertion.
// cast into var
Napi::Value val = obj["key"];
val.ToString();
// explicit cast
Napi::Value(obj["key"]).ToString();
It‘s fairly common to directly use it as a value, but the methods above are quite annoying. The first one needs to name the value, and the second one needs to move the cursor back. Thus I'd suggest adding a helper function behaves like the converter.
demo usage
obj["key"].value().ToString();
possible impl
Value value() const { return *this; }
Metadata
Metadata
Assignees
Type
Projects
Status
Todo