Issue 77623 in chromium: Make console.log() alias show the line number where alias was called

327 views
Skip to first unread message

chro...@googlecode.com

unread,
Mar 28, 2011, 6:03:32 AM3/28/11
to chromi...@chromium.org
Status: Unconfirmed
Owner: ----
Labels: Type-Bug Pri-2 Area-Undefined

New issue 77623 by pimvandenbogaerdt: Make console.log() alias show the
line number where alias was called
http://code.google.com/p/chromium/issues/detail?id=77623

Chrome Version : 10.0.648.204
URLs (if applicable) :

What steps will reproduce the problem?
1. Create a console.log() wrapper:
function log() {
console.log.apply(console, arguments);
}

2. Call it like log(1)

3. Look at the line number in the Developer Tools - it shows the line
number console.log was called (i.e. always the same). It would be more
useful if it displayed the line number where log() was called as it now
doesn't show useful information.

What is the expected result?
It shows the line number log() was called.

What happens instead?
It shows the line number console.log() was called, which is constant (i.e.
it is the line number where log() is declared).

Please provide any additional information below. Attach a screenshot if
possible.
I tried:
var log = console.log
to no avail (Illegal invocation).

chro...@googlecode.com

unread,
Mar 28, 2011, 6:47:30 AM3/28/11
to chromi...@chromium.org
Updates:
Labels: -Type-Bug -Area-Undefined Type-Feature Area-WebKit Feature-DevTools

Comment #1 on issue 77623 by temp01...@gmail.com: Make console.log() alias

show the line number where alias was called
http://code.google.com/p/chromium/issues/detail?id=77623

(No comment was entered for this change.)

chro...@googlecode.com

unread,
Mar 28, 2011, 8:28:39 AM3/28/11
to chromi...@chromium.org
Updates:
Status: WontFix

Comment #2 on issue 77623 by pfel...@chromium.org: Make console.log()

alias show the line number where alias was called
http://code.google.com/p/chromium/issues/detail?id=77623

console.log is supposed to dump its line, not the line of any of its
wrappers.

you can try

var log = console.log.bind(console);

to work around the illegal invocation problem.


Reply all
Reply to author
Forward
0 new messages