[Webkit-unassigned] [Bug 54337] New: JS: console.log.apply() broken, throws TypeError

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Feb 12 01:31:00 PST 2011


           Summary: JS: console.log.apply() broken, throws TypeError
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Macintosh
        OS/Version: Mac OS X 10.6
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: New Bugs
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: rich at indieimage.com

I created a wrapper function "log()" to check if console.log exists before sending messages to it; this allows my code to run without errors on IE and Firefox (when Firebug is disabled). The function passes its arguments on to console.log() by converting the 'arguments' object to an array and calling:

console.log.apply(this, argsArray);

On Firefox with Firebug installed this works as intended. In WebKit, however, it raises a TypeError with the unhelpful text description "type error".

Reproducing this bug is easy. Just open a JavaScript console and enter: 

console.log.apply(this, ["Hello World"]);

This bug effects console.log.call as well. Replacing 'this' with any other value yields the same result.

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list