diff --git a/tasks/lib/removelogging.js b/tasks/lib/removelogging.js index ef8fedd..7fc70a2 100644 --- a/tasks/lib/removelogging.js +++ b/tasks/lib/removelogging.js @@ -21,8 +21,8 @@ exports.init = function(grunt) { opts.verbose = true; } - rConsole = new RegExp("(" + opts.namespace.join("|") + ")" + ".(?:" + opts.methods.join("|") + ")\\s{0,}\\([^;]*\\)(?!\\s*[;,]?\\s*\\/\\*\\s*RemoveLogging:skip\\s*\\*\\/)\\s{0,};?", "gi"); - + rConsole = new RegExp("(" + opts.namespace.join("|") + ")" + "\\.(?:" + opts.methods.join("|") + ")\\s{0,}\\(([^;()]*(\\([^;)]*\\))*)*\\)(?!\\s*[;,]?\\s*\\/\\*\\s*RemoveLogging:skip\\s*\\*\\/)\\s{0,};?", "gi"); + src = src.replace(rConsole, function() { counter++; return opts.replaceWith || ""; diff --git a/test/test.js b/test/test.js index 7810891..3a24cc9 100644 --- a/test/test.js +++ b/test/test.js @@ -37,6 +37,12 @@ var tests = [ {}, ';if(true){functionCall(function namedFun(){})};for(var x=1;x