source: Dev/branches/rest-dojo-ui/client/util/shrinksafe/tests/stripconsole.js @ 256

Last change on this file since 256 was 256, checked in by hendrikvanantwerpen, 13 years ago

Reworked project structure based on REST interaction and Dojo library. As
soon as this is stable, the old jQueryUI branch can be removed (it's
kept for reference).

File size: 894 bytes
Line 
1result = "";
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. */
6var 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. */
14var 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.