Date.prototype.setDate doesn't convert float to integer
Reported by
kossnoc...@gmail.com,
May 25 2018
|
||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36 Steps to reproduce the problem: const date = new Date(2018, 1) date.setDate(11.2) console.assert(date.getHours() === 0, "The hour should't be changed") What is the expected behavior? setDate should round the passed value. What went wrong? The passed value wasn't rounded so it affected the time. Did this work before? N/A Chrome version: 66.0.3359.181 Channel: stable OS Version: OS X 10.13.3 Flash Version:
,
May 25 2018
Bisected to 9e217ee4900a6b598967039e936af12dc3c4d06b "[builtins] Refactor the remaining Date builtins" Landed in 49.0.2620.0 via r368886
,
May 27 2018
,
May 28 2018
Able to reproduce the issue on Mac 10.13.3, Win-10 and Ubuntu 17.10 using chrome reported version #66.0.3359.181 and latest canary #69.0.3442.0. This is a non-regression issue as it is observed from M60 old builds. Hence, marking it as untriaged to get more inputs from dev team. Thanks...!!
,
May 29 2018
,
May 30 2018
I'd like to fix this.
,
Jun 5 2018
The following revision refers to this bug: https://chromium.googlesource.com/v8/v8.git/+/10cfe818bd3e6fff08a4e5d17be11a94021b2d9d commit 10cfe818bd3e6fff08a4e5d17be11a94021b2d9d Author: Amos Lim <eui-sang.lim@samsung.com> Date: Tue Jun 05 09:27:39 2018 [builtins] Convert double to integer in Date.prototype.setDate date in Makeday should be converted to integer. https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.12 Bug: v8:7475 , chromium:846723 Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng Change-Id: I3aa725e7ce1822345502284aec919695c4ca084d Reviewed-on: https://chromium-review.googlesource.com/1080110 Commit-Queue: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#53516} [modify] https://crrev.com/10cfe818bd3e6fff08a4e5d17be11a94021b2d9d/AUTHORS [modify] https://crrev.com/10cfe818bd3e6fff08a4e5d17be11a94021b2d9d/src/builtins/builtins-date.cc [modify] https://crrev.com/10cfe818bd3e6fff08a4e5d17be11a94021b2d9d/test/mjsunit/date.js [modify] https://crrev.com/10cfe818bd3e6fff08a4e5d17be11a94021b2d9d/test/test262/test262.status
,
Jun 5 2018
,
Jun 5 2018
,
Jun 6 2018
Your change meets the bar and is auto-approved for M68. Please go ahead and merge the CL to branch 3440 manually. Please contact milestone owner if you have questions. Owners: cmasso@(Android), kariahda@(iOS), bhthompson@(ChromeOS), abdulsyed@(Desktop) For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jun 6 2018
Able to reproduce the issue on Mac 10.13.3 using chrome build without fix. Verified the fix on Mac 10.13.3, Win-10 and Ubuntu 17.10 using Chrome version #69.0.3451.0 as per the issue id: v8:7475 in comment #7. Attaching screen shot for reference. Observed that setDate rounded the passed value. Hence, the fix is working as expected. Adding the verified labels. Thanks...!!
,
Jun 6 2018
The following revision refers to this bug: https://chromium.googlesource.com/v8/v8.git/+/d95c2e8041c7bd46f947794a00b5b9ccda7f093e commit d95c2e8041c7bd46f947794a00b5b9ccda7f093e Author: jgruber <jgruber@chromium.org> Date: Wed Jun 06 12:20:22 2018 Merged: [builtins] Convert double to integer in Date.prototype.setDate This is a combined merge of two CLs: [builtins] Convert double to integer in Date.prototype.setDate https://crrev.com/c/1080110 [date] Fix double-to-int conversion in MakeDay https://crrev.com/c/1087063 No-Try: true No-Presubmit: true No-Treechecks: true Bug: v8:7475 , chromium:846723 Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng Change-Id: I3aa725e7ce1822345502284aec919695c4ca084d Reviewed-on: https://chromium-review.googlesource.com/1080110 Commit-Queue: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#53516}(cherry picked from commit 10cfe818bd3e6fff08a4e5d17be11a94021b2d9d) Reviewed-on: https://chromium-review.googlesource.com/1088790 Cr-Commit-Position: refs/branch-heads/6.8@{#15} Cr-Branched-From: 44d7d7d6b1041b57644400a00cb3fee35f6c51b2-refs/heads/6.8.275@{#1} Cr-Branched-From: 5754f66f75136dc17b4c63fec84f31dfdb89186e-refs/heads/master@{#53286} [modify] https://crrev.com/d95c2e8041c7bd46f947794a00b5b9ccda7f093e/AUTHORS [modify] https://crrev.com/d95c2e8041c7bd46f947794a00b5b9ccda7f093e/src/builtins/builtins-date.cc [modify] https://crrev.com/d95c2e8041c7bd46f947794a00b5b9ccda7f093e/test/mjsunit/date.js [add] https://crrev.com/d95c2e8041c7bd46f947794a00b5b9ccda7f093e/test/mjsunit/regress/regress-849663.js [modify] https://crrev.com/d95c2e8041c7bd46f947794a00b5b9ccda7f093e/test/test262/test262.status
,
Jun 6 2018
And merged to 68. Thanks all!
,
Jun 6 2018
👏 |
||||||||||
►
Sign in to add a comment |
||||||||||
Comment 1 by kossnoc...@gmail.com
, May 25 2018