diff --git a/Gruntfile.js b/Gruntfile.js index 0ab7ae149..6f47bce81 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -142,7 +142,7 @@ module.exports = function( grunt ) { // Remove browserify wrappers. .replace( /^\(function\(f\){if\(typeof exports==="object"&&type.*/, "" ) - .replace( /},{}\]},{},\[1\]\)\(1\)[\s\S]*?$/, "" ) + .replace( /\},\{\}\]\},\{\},\[1\]\)\(1\)[\s\S]*?$/, "" ) // Remove browserify exports. .replace( /Object.defineProperty\(exports[\s\S]*?\n}\);/, "" ) @@ -156,10 +156,10 @@ module.exports = function( grunt ) { .replace( "this.tests.add(type, cat, examples);", "" ) // Remove load method. - .replace( /load: {[\s\S]*?\n }/, "" ) + .replace( /load: \{[\s\S]*?\n \}/, "" ) // Replace its wrapper into var assignment. - .replace( /\(function \(global\) {/, [ + .replace( /\(function \(global\) \{/, [ "var MakePlural;", "/* jshint ignore:start */", "MakePlural = (function() {" @@ -187,10 +187,10 @@ module.exports = function( grunt ) { return contents // Remove browserify wrappers. - .replace( /^\(function\(f\){if\(typeof exports==="object"&&type.*/, "" ) + .replace( /^\(function\(f\)\{if\(typeof exports==="object"&&type.*/, "" ) .replace( "},{}],2:[function(require,module,exports){", "" ) - .replace( /},{"\.\/messageformat-parser":1,"make-plural\/plural.*/, "" ) - .replace( /},{}\]},{},\[2\]\)\(2\)[\s\S]*?$/, "" ) + .replace( /\},\{"\.\/messageformat-parser":1,"make-plural\/plural.*/, "" ) + .replace( /\},\{\}\]\},\{\},\[2\]\)\(2\)[\s\S]*?$/, "" ) // Set `MessageFormat.plurals` and remove `make-plural/plurals` // completely. This is populated by Globalize on demand. @@ -205,17 +205,17 @@ module.exports = function( grunt ) { "MessageFormat._parse = require('./messageformat-parser').parse;", "" ) - .replace( /module\.exports = \(function\(\) {([\s\S]*?)\n}\)\(\);/, [ + .replace( /module\.exports = \(function\(\) \{([\s\S]*?)\n\}\)\(\);/, [ "MessageFormat._parse = (function() {", "$1", "}()).parse;" ].join( "\n" ) ) // Remove unused code. - .replace( /if \(!pluralFunc\) {\n[\s\S]*?\n }/, "" ) - .replace( /if \(!locale\) {\n[\s\S]*? }\n/, "this.lc = [locale];" ) - .replace( /(MessageFormat\.formatters) = {[\s\S]*?\n};/, "$1 = {};" ) - .replace( /MessageFormat\.prototype\.setIntlSupport[\s\S]*?\n};/, "" ) + .replace( /if \(!pluralFunc\) \{\n[\s\S]*?\n \}/, "" ) + .replace( /if \(!locale\) \{\n[\s\S]*? \}\n/, "this.lc = [locale];" ) + .replace( /(MessageFormat\.formatters) = \{[\s\S]*?\n\};/, "$1 = {};" ) + .replace( /MessageFormat\.prototype\.setIntlSupport[\s\S]*?\n\};/, "" ) // Wrap everything into a var assignment. .replace( "module.exports = MessageFormat;", "" ) @@ -248,7 +248,7 @@ module.exports = function( grunt ) { // 1, and 2: Remove define() wrap. // 3: Remove empty define()'s. contents = contents - .replace( /define\([^{]*?{/, "" ) /* 1 */ + .replace( /define\([^{]*?\{/, "" ) /* 1 */ .replace( rdefineEnd, "" ) /* 2 */ .replace( /define\(\[[^\]]+\]\)[\W\n]+$/, "" ); /* 3 */