The default bug view has changed. See this FAQ.

"Assertion failure: ToInteger(year) == year," or "Assertion failure: ToInteger(date) == date," or "Assertion failure: ToInteger(month) == month,"

RESOLVED FIXED in mozilla16

Status

()

Core
JavaScript Engine
--
critical
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: gkw, Assigned: Waldo)

Tracking

(Blocks: 1 bug, {assertion, regression, testcase})

Trunk
mozilla16
assertion, regression, testcase
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [js:t])

Attachments

(2 attachments)

(Reporter)

Description

5 years ago
Created attachment 640099 [details]
stack

Date.prototype.setFullYear(Math.cos(1))

asserts js debug shell on m-c changeset 221f1a184f67 without any CLI arguments at Assertion failure: ToInteger(year) == year,

autoBisect shows this is probably related to the following changeset:

The first bad revision is:
changeset:   98627:e68d62b3ab83
user:        Jeff Walden
date:        Fri Jul 06 13:53:11 2012 -0700
summary:     Bug 771742 - Reimplement the Date.prototype.set<date component> functions in terms of their spec steps, and remove the hard-to-understand date_makeDate.  r=luke
(Reporter)

Comment 1

5 years ago
Date.prototype.setUTCDate(Math.tan(1))

asserts at a similar assertion:

Assertion failure: ToInteger(date) == date,
Summary: "Assertion failure: ToInteger(year) == year," → "Assertion failure: ToInteger(year) == year," or "Assertion failure: ToInteger(date) == date,"
Assignee: general → jwalden+bmo
Status: NEW → ASSIGNED
OS: Mac OS X → All
Hardware: x86_64 → All

Comment 2

5 years ago
No need for trig functions. You can substitute the value and still assert:

Date.prototype.setUTCDate(1.5)
(Reporter)

Comment 3

5 years ago
Date.prototype.setMonth(1.5)

Assertion failure: ToInteger(month) == month,
Summary: "Assertion failure: ToInteger(year) == year," or "Assertion failure: ToInteger(date) == date," → "Assertion failure: ToInteger(year) == year," or "Assertion failure: ToInteger(date) == date," or "Assertion failure: ToInteger(month) == month,"
Created attachment 640359 [details] [diff] [review]
Convert most date spec methods to take, produce doubles

I don't know how we managed to avoid all the intermediate checking before, at least not without being buggy in boundary cases.  But I think this covers everything.
Attachment #640359 - Flags: review?(luke)

Comment 5

5 years ago
Comment on attachment 640359 [details] [diff] [review]
Convert most date spec methods to take, produce doubles

Goofy
Attachment #640359 - Flags: review?(luke) → review+
Whiteboard: js-triage-needed → [js:t]
https://hg.mozilla.org/integration/mozilla-inbound/rev/57e0bdd6f6c7
Target Milestone: --- → mozilla16
https://hg.mozilla.org/mozilla-central/rev/57e0bdd6f6c7
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Automatically extracted testcase for this bug was committed:

https://hg.mozilla.org/mozilla-central/rev/efaf8960a929
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.