Bug 11609
Summary: | Function.toString removes commas from the function body | ||
---|---|---|---|
Product: | WebKit | Reporter: | Bertrand Le Roy <bleroy> |
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED WORKSFORME | ||
Severity: | Normal | CC: | ap |
Priority: | P2 | ||
Version: | 419.x | ||
Hardware: | PC | ||
OS: | OS X 10.4 |
Bertrand Le Roy
function foo() {
var e = {name: "value", type: Number, integer: true};
return e;
}
alert(foo.toString().indexOf(','));
Should show a positive integer, it shows -1. Seems to be fixed in the latest WebKit build but it's pretty bad as you can't eval a function's toString and get a working function.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
This works correctly in the latest WebKit indeed, and there is unfortunately nothing we can do to make vendors integrate the fix faster - one has to contact Apple, Omni and others separately for this :-(.
Bertrand Le Roy
Yes, well, I filed this mainly for it to be documented, in case someone else hits the problem. As far as I'm concerned it's ok if it's not fixed for the current Safari: it doesn't block any important feature on our side.
Thanks for looking into it.