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 behavior currently happens by default for Record wrappers because they have a null prototype.
#{}==Object(#{})// throws
It seems more future-proof to allow Record wrappers to safely pass ToPrimitive by unwrapping to their record primitive content. ToString and ToNumber can still throw.
We could add support for this either by adding a direct case for handing records to ToPrimitive, or always add a non-enumerable Symbol.toPrimitive to Record wrappers - though this would add a new hidden intrinsic.
The text was updated successfully, but these errors were encountered:
ToPrimitive of an object relies on looking up methods on the value, there is no default behavior:
This behavior currently happens by default for Record wrappers because they have a null prototype.
It seems more future-proof to allow Record wrappers to safely pass
ToPrimitive
by unwrapping to their record primitive content.ToString
andToNumber
can still throw.We could add support for this either by adding a direct case for handing records to
ToPrimitive
, or always add a non-enumerableSymbol.toPrimitive
to Record wrappers - though this would add a new hidden intrinsic.The text was updated successfully, but these errors were encountered: