From aa1a3cdf4988b477a6bf40803e304eee5bebe1de Mon Sep 17 00:00:00 2001 From: Ghislain Seguin Date: Thu, 8 Dec 2011 13:48:07 -0800 Subject: [PATCH] Updated AMD stripping regexp --- js/r-jqm.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/r-jqm.js b/js/r-jqm.js index ecf867bc..daae1e18 100644 --- a/js/r-jqm.js +++ b/js/r-jqm.js @@ -8812,10 +8812,11 @@ function (lang, logger, file, parse, optimize, pragma, //Added for jQuery Mobile build as we are only interested in the dependency resolution currContents = currContents //.replace(/\brequire\(\s*[^\]]*].*function\(\s*\)\s*\{[^}]*\}\)\W*/, "") // Get rid of the require block - .replace(/^\[[^\]]+\]\s*,?[);]*\s*function.*\{/m, "(function( $, undefined ) {") - .replace(/\);?\s*$/, "( jQuery ));"); + .replace(/^(:?\[[^\]]*\]\s*,\s*)?[);]*\s*function.*\{/m, "(function() {") + .replace(/\);?\s*$/, "());"); - currContents = currContents.replace(/\s*\(function\(.*\)\s*\{\s*\}\([^)]*\)\);/, "") // Get rid of empty functions + currContents = currContents.replace(/\s*\(function\(.*\)\s*\{\s*\}\([^)]*\)\);/, ""); // Get rid of empty functions + currContents = currContents.replace(/\s*\(function\(.*\)\s*\{\s*require\([^\)]*\);?\s*\}\([^)]*\)\);?/, ""); // Get rid of require( [init] ) function //Semicolon is for files that are not well formed when //concatenated with other content.