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: Using both dateStyle and timeStyle throws a TypeError #3061

Open
anba opened this issue Dec 11, 2024 · 2 comments
Open

Polyfill: Using both dateStyle and timeStyle throws a TypeError #3061

anba opened this issue Dec 11, 2024 · 2 comments
Labels
non-prod-polyfill THIS POLYFILL IS NOT FOR PRODUCTION USE! test262

Comments

@anba
Copy link
Contributor

anba commented Dec 11, 2024

new Temporal.PlainDateTime(2024, 12, 11).toLocaleString("en", {dateStyle: "full", timeStyle: "full"})

Throws:

Uncaught TypeError: can't set option hour when dateStyle is used
    getSlotLazy intl.mjs:57
    extractOverrides intl.mjs:595
    format intl.mjs:232
    Call Call.js:19
    boundFormat intl.mjs:169
    toLocaleString plaindatetime.mjs:262
    <anonymous> debugger eval code:1
@ptomato
Copy link
Collaborator

ptomato commented Dec 12, 2024

Haha, the bot code seems somewhat plausible but will unfortunately regress #2795. So a different solution is needed. I assume this was missed because there's a test262 coverage gap, so we should have test262 coverage for this case as well.

@ptomato ptomato added non-prod-polyfill THIS POLYFILL IS NOT FOR PRODUCTION USE! test262 labels Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
non-prod-polyfill THIS POLYFILL IS NOT FOR PRODUCTION USE! test262
Projects
None yet
Development

No branches or pull requests

3 participants
@ptomato @anba and others