Bug 185563 - TimeClip's incorrect ToInteger
Summary: TimeClip's incorrect ToInteger
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-05-11 14:09 PDT by Leo Balter
Modified: 2018-05-14 08:05 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Leo Balter 2018-05-11 14:09:38 PDT
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)`
Comment 1 Leo Balter 2018-05-14 08:04:03 PDT
Sounds like this is fixed by the Bug 185578 / https://trac.webkit.org/changeset/231740
Comment 2 Radar WebKit Bug Importer 2018-05-14 08:05:14 PDT
<rdar://problem/40217650>