Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

34 lines (26 sloc) 1.056 kb
# Stub the console when not available so that everything still works.
functions = [
"log", "debug", "info", "warn", "exception", "assert", "dir", "dirxml",
"trace", "group", "groupEnd", "groupCollapsed", "time", "timeEnd", "profile",
"profileEnd", "count", "clear", "table", "error", "notifyFirebug", "firebug",
if console?
# Opera's console doesn't have a group function as of 2010-07-01
if not = (name) -> console.log "GROUP: ", name
# Webkit's developer console has yet to implement groupCollapsed as of 2010-07-01
if not console.groupCollapsed?
console.groupCollapsed =
# Stub out any remaining functions
for fn in functions
if not console[fn]?
console[fn] = -> console.log _t("Not implemented:") + " console.#{name}"
this.console = {}
for fn in functions
this.console[fn] = ->
this.console['error'] = (args...) ->
alert("ERROR: #{args.join(', ')}")
this.console['warn'] = (args...) ->
alert("WARNING: #{args.join(', ')}")
Jump to Line
Something went wrong with that request. Please try again.