Closed Bug 781154 Opened 12 years ago Closed 11 years ago

JS_ObjectIsDate returns false for Date objects created in a script.

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: raphc, Unassigned)

Details

(Whiteboard: [fixed by bug 856833])

Attachments

(3 files)

      No description provided.
Summary: JS_ObjectIsDate returns false for Date objs → JS_ObjectIsDate returns false for Date objects created in a script.
Test case?
Raphael, maybe you could attach a patch that adds the usage of JS_ObjectIsDate() for .valueAsDate and a test case? We need to have the other patches to land though.
Attached patch input date baseSplinter Review
Actually this problem only happens in the web console.
I saw this problem when testing the input <type=date> valueAsDate attribute. When you apply these patches (and enable the dom.experimental-forms setting) you should be able to use >input.valueAsDate = new Date().

The mochitests for valueAsDate() are working fine. But if you do the same in a console, it doesn't work, because JS_ObjectIsDate() returns false.
It's probably failing on the wrapped version.
I saw that the class of this object when created in the console was proxy instead of date. Is that what you call wrapped version? Can that happen somewhere else than in the console?
This behavior is disturbing for webdevs who want to use the web console to test code related to valueAsDate, but otherwise not a major issue for the input date implementation itself.
Whiteboard: [js:p3]
Very likely this bug can't be reproduced in Nightly any more because we use WebIDL bindings for input elements so maybe it could be interesting to have a look before it is no longer reproducible in all versions of Firefox?
Flags: needinfo?(jwalden+bmo)
I'm not quite sure what's desired here.  Having the relevant JS_ObjectIsDate bits via WebIDL should solve this, yes, and when I test in a nightly it does indeed work.  (Although I ran across bug 874640 when doing so, and got derailed for a bit on that.)  What do you want me to do here, exactly?
Flags: needinfo?(jwalden+bmo)
(In reply to Jeff Walden [:Waldo] (remove +bmo to email) from comment #10)
> I'm not quite sure what's desired here.  Having the relevant JS_ObjectIsDate
> bits via WebIDL should solve this, yes, and when I test in a nightly it does
> indeed work.  (Although I ran across bug 874640 when doing so, and got
> derailed for a bit on that.)  What do you want me to do here, exactly?

I was wondering if you could look at this bug to see if it wasn't coming from a more important underlying bug that we might want to fix.
Flags: needinfo?(jwalden+bmo)
Oh.  The underlying issue was all but certainly fixed in http://hg.mozilla.org/mozilla-central/rev/f8a7c4c4874d which would make us good now.
Flags: needinfo?(jwalden+bmo)
Thanks Waldo :)
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [js:p3] → [fixed by bug 856833]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: