Summary: | ''.constructor.toString() gives [function] | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Christopher Schmidt <crschmidt> | ||||
Component: | JavaScriptCore | Assignee: | Darin Adler <darin> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | Keywords: | HasReduction | ||||
Priority: | P2 | ||||||
Version: | 523.x (Safari 3) | ||||||
Hardware: | Mac | ||||||
OS: | OS X 10.4 | ||||||
URL: | http://crschmidt.net/projects/webkit/tostring.html | ||||||
Attachments: |
|
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? 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. 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. Created attachment 18709 [details]
patch
Committed revision 29817. |
''.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.)