Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polyfill: Refine valueOf exception message (again) #2691

Merged
merged 1 commit into from
Oct 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions polyfill/lib/ecmascript.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5866,9 +5866,10 @@ export function ValueOfThrows(constructorName) {
throw new TypeError(
'Do not use built-in arithmetic operators with Temporal objects. ' +
`When comparing, use ${compareCode}, not obj1 > obj2. ` +
"When coercing to strings, use obj.toString() or String(obj), not +obj nor '' + obj. " +
'When concatenating with strings, use str.concat(obj) or `${str}${obj}`, not str + obj. ' +
'In React, call obj.toString() before rendering a Temporal object.'
"When coercing to strings, use `${obj}` or String(obj), not '' + obj. " +
'When coercing to numbers, use properties or methods of the object, not `+obj`. ' +
'When concatenating with strings, use `${str}${obj}` or str.concat(obj), not str + obj. ' +
'In React, coerce to a string before rendering a Temporal object.'
);
}

Expand Down