Rev | Line | |
---|
[483] | 1 | result = ""; |
---|
| 2 | |
---|
| 3 | /* For the purpose of these tests, we have no actual console with |
---|
| 4 | which to test output, so create a dummy console and capture to |
---|
| 5 | 'result', which is examined by the test framework post eval. */ |
---|
| 6 | var console = { |
---|
| 7 | debug: function(arg) { result += "DEBUG: " + arg; }, |
---|
| 8 | warn: function(arg) { result += "WARN: " + arg; }, |
---|
| 9 | error: function(arg) { result += "ERROR: " + arg; }, |
---|
| 10 | dir: function(arg) { result += "DIR: " + arg; } |
---|
| 11 | }; |
---|
| 12 | /* Make something that looks a bit like console to ensure it |
---|
| 13 | isn't stripped. */ |
---|
| 14 | var notconsole = { |
---|
| 15 | debug: function(arg) { result += arg; }, |
---|
| 16 | warn: function(arg) { result += arg; } |
---|
| 17 | }; |
---|
| 18 | (function() { |
---|
| 19 | var variable = 'variable'; |
---|
| 20 | |
---|
| 21 | console.debug("debug here!" + variable); |
---|
| 22 | console.warn("warn here!"); |
---|
| 23 | console.error("error here!"); |
---|
| 24 | notconsole.debug("notconsole debug here!"); |
---|
| 25 | notconsole.warn("notconsole warn here!"); |
---|
| 26 | |
---|
| 27 | console.dir(notconsole); |
---|
| 28 | })(); |
---|
Note: See
TracBrowser
for help on using the repository browser.