Closed Bug 771946 Opened 12 years ago Closed 12 years ago

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

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla16

People

(Reporter: gkw, Assigned: Waldo)

References

Details

(Keywords: assertion, regression, testcase, Whiteboard: [js:t])

Attachments

(2 files)

Attached file 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
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
No need for trig functions. You can substitute the value and still assert: Date.prototype.setUTCDate(1.5)
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,"
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 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]
Target Milestone: --- → mozilla16
Status: ASSIGNED → RESOLVED
Closed: 12 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.

Attachment

General

Created:
Updated:
Size: