Hi,
When any Temporal object has its valueOf function called, it
intentionally throws a TypeError with a specific message. For example
with Temporal.PlainDate:
"Do not use Temporal.PlainDate.prototype.valueOf; use
Temporal.PlainData.prototype.compare for comparison."
However, there's a mistake in this message. It says
Temporal.PlainDate.prototype.compare, but that doesn't exist. The correct
function is actually Temporal.PlainDate.compare. This caused me some
confusion.
Example:
Temporal.PlainDate.from("2025-05-19").compare -> undefined
Temporal.PlainDate.compare -> [Function: compare]
The message is generated by this code:
https://github.com/v8/v8/blob/main/src/builtins/builtins-temporal.cc#L113
Can I fix this?
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/v8-dev/678b43e9-431c-4228-bc9c-cb05ca8082fd%40disroot.org.