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

Unexpected zero seconds shown in Duration.prototype._repr_ output #1371

Closed
justingrant opened this issue Feb 19, 2021 · 0 comments · Fixed by #1376
Closed

Unexpected zero seconds shown in Duration.prototype._repr_ output #1371

justingrant opened this issue Feb 19, 2021 · 0 comments · Fixed by #1376
Labels
bug non-prod-polyfill THIS POLYFILL IS NOT FOR PRODUCTION USE!

Comments

@justingrant
Copy link
Collaborator

justingrant commented Feb 19, 2021

The debugging-only _repr_ getter (which is used to show the contents of a Duration in the polyfill while debugging with Chrome devtools console) has an extra 0.0S appended to its output that should not be there. The output should match toString().

Repro: run the following code in Chrome devtools console:

Temporal.Duration.from('P73DT4H')

Expected: Duration {_repr_: "Temporal.Duration <P73DT4H>"} (_repr_ should have same output as toString())
Actual: Duration {_repr_: "Temporal.Duration <P73DT4H0.0S>"}

Note that the _repr_ is only for debugging the pre-production polyfill. It's not present in the 262 spec so fixing this won't affect the spec.

@justingrant justingrant added bug non-prod-polyfill THIS POLYFILL IS NOT FOR PRODUCTION USE! labels Feb 19, 2021
justingrant added a commit to justingrant/proposal-temporal that referenced this issue Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug non-prod-polyfill THIS POLYFILL IS NOT FOR PRODUCTION USE!
Projects
None yet
1 participant