| Summary: | Date constructor with negative value argument | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | gfablima |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED WORKSFORME | ||
| Severity: | Normal | CC: | ashvayka, isol2, msaboff |
| Priority: | P2 | ||
| Version: | Safari 11 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
|
Description
gfablima
2018-07-10 08:38:46 PDT
Daily build v233772 not reproduce this issue (In reply to isol2 from comment #1) > Daily build v233772 not reproduce this issue r261927 doesn't reproduce this either. (In reply to gfablima from comment #0) > I was looking on ES6 specification about this issue but I didn't found an > answer, maybe the correct way is convert the -0 to +0 > as V8 and SpiderMonkey do. Date constructor (https://tc39.es/ecma262/#sec-date-value) performs TimeClip at step 4.d, which uses ToInteger (https://tc39.es/ecma262/#sec-tointeger) to normalize -0 to 0 (step 2). This is covered by: https://test262.report/browse/built-ins/Date/TimeClip_negative_zero.js https://test262.report/browse/built-ins/Date/prototype/getTime/this-value-valid-date.js https://test262.report/browse/built-ins/Date/prototype/valueOf/S9.4_A3_T2.js (all passed by JSC) |