source: Dev/trunk/src/client/util/build/transforms/optimizer/stripConsole.js

Last change on this file was 483, checked in by hendrikvanantwerpen, 11 years ago

Added Dojo 1.9.3 release.

File size: 554 bytes
Line 
1define(["../../buildControl"], function(bc){
2        if(bc.stripConsole){
3                var consoleMethods = "assert|count|debug|dir|dirxml|group|groupEnd|info|profile|profileEnd|time|timeEnd|trace|log";
4                if(bc.stripConsole === "warn"){
5                        consoleMethods += "|warn";
6                }else if(bc.stripConsole === "all"){
7                        consoleMethods += "|warn|error";
8                }
9                var stripConsoleRe = new RegExp("console\\.(" + consoleMethods + ")\\s*\\(", "g");
10                return function(text){
11                        return text.replace(stripConsoleRe, "0 && $&");
12                };
13        }else{
14                return function(text){
15                        return text;
16                };
17        }
18});
Note: See TracBrowser for help on using the repository browser.