Bug 11609

Summary: Function.toString removes commas from the function body
Product: WebKit Reporter: Bertrand Le Roy <bleroy>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED WORKSFORME    
Severity: Normal CC: ap
Priority: P2    
Version: 419.x   
Hardware: PC   
OS: OS X 10.4   

Description Bertrand Le Roy 2006-11-15 17:17:35 PST
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.
Comment 1 Alexey Proskuryakov 2006-11-15 22:27:33 PST
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 :-(.
Comment 2 Bertrand Le Roy 2006-11-15 22:51:21 PST
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.