Closed Bug 1217049 Opened 10 years ago Closed 10 years ago

Date.prototype.toString should throw when this-object is primitive

Categories

(Core :: JavaScript: Standard Library, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla45
Tracking Status
firefox44 --- affected
firefox45 --- fixed
b2g-v2.5 --- fixed

People

(Reporter: anba, Assigned: Waldo)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Test case: --- Date.prototype.toString.call(null) --- Expected: Throws TypeError Actual: Returns "Invalid Date" Spec: ES2015, 20.3.4.41 Date.prototype.toString ( ), step 1: > 1. Let O be this Date object. "this Date object" is defined in 20.3.4 Properties of the Date Prototype Object: > In following descriptions of functions that are properties of the Date prototype > object, the phrase “this Date object” refers to the object that is the this value > for the invocation of the function. If the Type of the this value is not Object, > a TypeError exception is thrown.
Attached patch PatchSplinter Review
Attachment #8677773 - Flags: review?(arai.unmht)
Assignee: nobody → jwalden+bmo
Status: NEW → ASSIGNED
Attachment #8677773 - Flags: review?(arai.unmht) → review+
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: