Closed Bug 584811 Opened 9 years ago Closed 9 years ago

Date.prototype.toJSON isn't to spec

Categories

(Core :: JavaScript Engine, defect)

defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: Waldo, Assigned: Waldo)

References

Details

(Keywords: dev-doc-complete, Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

Per ES5 it is not merely a clone of toISOString; it actually does something like the weirdness of Array.prototype.toString in that it does some checks, then delegates to |this.toISOString|.
(discovered via the MS ES5 tests, somewhat)
Attached patch Patch and testsSplinter Review
Attachment #465528 - Flags: review?(sayrer)
Comment on attachment 465528 [details] [diff] [review]
Patch and tests

Righteous.

>+
>+    if (!Invoke(cx, args, 0))
>+        return false;
>+    *vp = args.rval();
>+    return true;

I think the style police want a blank line before and after the assignment to *vp.
Attachment #465528 - Flags: review?(sayrer) → review+
(In reply to comment #3)
> Comment on attachment 465528 [details] [diff] [review]
> Patch and tests
> 
> Righteous.
> 
> >+
> >+    if (!Invoke(cx, args, 0))
> >+        return false;
> >+    *vp = args.rval();
> >+    return true;
> 
> I think the style police want a blank line before and after the assignment to
> *vp.

No -- who ever said so? Bad cop, no donut.

/be
http://hg.mozilla.org/tracemonkey/rev/2573e884e17b

I'm pretty sure I've seen both styles for the blank-line nit, or at least I have not seen one so often that it has consciously risen in my mind to the level of a gold standard.  Killed the blank line here, tho.
Whiteboard: fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/2573e884e17b
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.