You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a case of "I understand why it acts this way but it still feels weird." Maybe we could put this in the documentation, but filing it here so it's recorded somewhere at least.
One might expect them to both return the Object function.
This is probably because of the fact that VM checks whether or not the sandbox object has the requested property. In the first case, it can just check the target object, since V8 knows nothing funny is going on with [[Get]]. In the second, even though Reflect.get should act the same way as not specifying a trap, V8 doesn't know that, since unlike [[GetOwnProperty]]/getOwnPropertyDescriptor [[Get]]/get has no way of differentiating between an undefined-valued property and a nonexistent property.
after being initialized to true, was_found can only be set to false if the get trap is undefined, and prototype lookup for the Proxy target reveals nothing with that property name.
The text was updated successfully, but these errors were encountered:
This is a case of "I understand why it acts this way but it still feels weird." Maybe we could put this in the documentation, but filing it here so it's recorded somewhere at least.
One might expect them to both return the
Object
function.This is probably because of the fact that VM checks whether or not the sandbox object has the requested property. In the first case, it can just check the target object, since V8 knows nothing funny is going on with [[Get]]. In the second, even though
Reflect.get
should act the same way as not specifying a trap, V8 doesn't know that, since unlike [[GetOwnProperty]]/getOwnPropertyDescriptor
[[Get]]/get
has no way of differentiating between anundefined
-valued property and a nonexistent property.Code-wise,
node/deps/v8/src/objects.cc
Lines 1064 to 1116 in 35c01d8
after being initialized to true,
was_found
can only be set to false if theget
trap is undefined, and prototype lookup for the Proxy target reveals nothing with that property name.The text was updated successfully, but these errors were encountered: