WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
54337
JS: console.log.apply() broken, throws TypeError
https://bugs.webkit.org/show_bug.cgi?id=54337
Summary
JS: console.log.apply() broken, throws TypeError
Richard Connamacher
Reported
2011-02-12 01:31:00 PST
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.
Attachments
Add attachment
proposed patch, testcase, etc.
Alexey Proskuryakov
Comment 1
2011-02-12 13:25:45 PST
This is probably a duplicate of
bug 20141
, although it doesn't look exactly the same.
Richard Connamacher
Comment 2
2011-02-12 14:02:12 PST
(In reply to
comment #1
)
> This is probably a duplicate of
bug 20141
, although it doesn't look exactly the same.
It does look like a duplicate, though on further testing I learned that the bug itself is invalid. The code does work in Firefox, but the code itself had a problem. I marked it "RESOLVED INVALID".
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug