RESOLVED FIXED 16498
''.constructor.toString() gives [function]
https://bugs.webkit.org/show_bug.cgi?id=16498
Summary ''.constructor.toString() gives [function]
Christopher Schmidt
Reported 2007-12-17 20:53:10 PST
''.constructor.toString() gives back "[function]" in Safari. In FF and Opera (and I believe IE) this returns: >>> ''.constructor.toString() function String() { [native code] } or something similar. (Test.AnotherWay uses this as a way to determine what type of object something is for some reason I'm not sure I understand, which is how I bumped into it.)
Attachments
patch (23.75 KB, patch)
2008-01-26 10:02 PST, Darin Adler
oliver: review+
David Kilzer (:ddkilzer)
Comment 1 2007-12-18 05:49:57 PST
Confirmed difference to Firefox and Opera with a local debug build of WebKit r28774 with Safari 3.0.4 (523.12) on Mac OS X 10.4.11 (8S165). Is the format of the returned string for native functions covered by any spec?
Eric Seidel (no email)
Comment 2 2008-01-01 12:32:30 PST
If this is still an issue, it's easy enough to fix. We just need a good test case (w/o an alert, DRT compatible). Ideally one which uses the standard fast/js/ style of just being a .js file and using shouldBe, etc.
Darin Adler
Comment 3 2008-01-26 08:48:22 PST
functionProtoFuncToString already has a case that dumps in this format, with "native code" in the string. We just need to trigger it at the right time.
Darin Adler
Comment 4 2008-01-26 10:02:30 PST
Darin Adler
Comment 5 2008-01-27 00:57:54 PST
Committed revision 29817.
Note You need to log in before you can comment on or make changes to this bug.