Bug 185563
| Summary: | TimeClip's incorrect ToInteger | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Leo Balter <leo> |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Leo Balter
From the test262 runner (https://build.webkit.org/builders/Apple%20Sierra%20Release%20Test262%20%28Tests%29/builds/2187/steps/test262-test/logs/stdio)
- test/intl402/DateTimeFormat/prototype/format/time-clip-to-integer.js
- test/intl402/DateTimeFormat/prototype/formatToParts/time-clip-to-integer.js
Intl.DateTimeFormat#format calls are not properly extracting the ToInteger value from its first argument.
```
var dtf = new Intl.DateTimeFormat(undefined, {
hour: "numeric", minute: "numeric", second: "numeric"
});
dtf.format(-0.9) // expects dtf.format(0)
```
Currently returning the same as `dtf.format(-1)`
---
Also affects Intl.DateTimeFormat#formatToParts:
```
var dtf = new Intl.DateTimeFormat(undefined, {
hour: "numeric", minute: "numeric", second: "numeric"
});
function formatAsString(dtf, time) {
return dtf.formatToParts(time).map(part => part.value).join("");
}
formatAsString(dtf, -0.9) // expects formatAsString(dtf, 0)
```
Currently returning the same as `formatAsString(dtf, -1)`
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Leo Balter
Sounds like this is fixed by the Bug 185578 / https://trac.webkit.org/changeset/231740
Radar WebKit Bug Importer
<rdar://problem/40217650>