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).
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.)
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.