Line | |
---|
1 | define(["../../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.