From 00b5c69f5304e0b94426feb2759de3cf39ac3d3e Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Tue, 13 Sep 2016 18:01:14 -0700 Subject: [PATCH] Minor gulpfile/Gruntfile corrections --- Gruntfile.js | 8 ++++---- gulpfile.js | 7 +++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 333e50827..8651d1895 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -199,7 +199,7 @@ module.exports = function(grunt) { banner: '"use strict";\n\n', process: function(src, filepath) { return "// " + filepath + "\n\n" + - src.replace(/(^|\n)[ \t]*(['"])use strict\2;?\s*/g, '$1').replace(/[ \t]*if\s*\(NODE\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '').replace(/[ \t]*if\s*\(typeof\s+module\s*!==\s*(['"])undefined\2\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '').replace(/[ \t]*[A-Za-z_][A-Za-z0-9_\.]*\.assert\([^\n]*\);[^\n]*/g, ''); + src.replace(/(^|\n)[ \t]*(['"])use strict\2;?\s*/g, '$1').replace(/[ \t]*if\s*\(NODE\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '').replace(/[ \t]*if\s*\(typeof\s+module\s*!==\s*(['"])undefined\1\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '').replace(/[ \t]*[A-Za-z_][A-Za-z0-9_\.]*\.assert\([^\n]*\);[^\n]*/g, ''); } } }, @@ -210,7 +210,7 @@ module.exports = function(grunt) { banner: '"use strict";\n\n', process: function(src, filepath) { return "// " + filepath + "\n\n" + - src.replace(/(^|\n)[ \t]*(['"])use strict\2;?\s*/g, '$1').replace(/[ \t]*if\s*\(NODE\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '').replace(/[ \t]*if\s*\(typeof\s+module\s*!==\s*(['"])undefined\2\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '').replace(/[ \t]*[A-Za-z_][A-Za-z0-9_\.]*\.assert\([^\n]*\);[^\n]*/g, ''); + src.replace(/(^|\n)[ \t]*(['"])use strict\2;?\s*/g, '$1').replace(/[ \t]*if\s*\(NODE\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '').replace(/[ \t]*if\s*\(typeof\s+module\s*!==\s*(['"])undefined\1\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '').replace(/[ \t]*[A-Za-z_][A-Za-z0-9_\.]*\.assert\([^\n]*\);[^\n]*/g, ''); } } }, @@ -221,7 +221,7 @@ module.exports = function(grunt) { banner: '"use strict";\n\n', process: function(src, filepath) { return "// " + filepath + "\n\n" + - src.replace(/(^|\n)[ \t]*(['"])use strict\2;?\s*/g, '$1').replace(/[ \t]*if\s*\(NODE\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '').replace(/[ \t]*if\s*\(typeof\s+module\s*!==\s*(['"])undefined\2\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '').replace(/[ \t]*[A-Za-z_][A-Za-z0-9_\.]*\.assert\([^\n]*\);[^\n]*/g, ''); + src.replace(/(^|\n)[ \t]*(['"])use strict\2;?\s*/g, '$1').replace(/[ \t]*if\s*\(NODE\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '').replace(/[ \t]*if\s*\(typeof\s+module\s*!==\s*(['"])undefined\1\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '').replace(/[ \t]*[A-Za-z_][A-Za-z0-9_\.]*\.assert\([^\n]*\);[^\n]*/g, ''); } } }, @@ -232,7 +232,7 @@ module.exports = function(grunt) { banner: '"use strict";\n\n', process: function(src, filepath) { return "// " + filepath + "\n\n" + - src.replace(/(^|\n)[ \t]*(['"])use strict\2;?\s*/g, '$1').replace(/[ \t]*if\s*\(NODE\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '').replace(/[ \t]*if\s*\(typeof\s+module\s*!==\s*(['"])undefined\2\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '').replace(/[ \t]*[A-Za-z_][A-Za-z0-9_\.]*\.assert\([^\n]*\);[^\n]*/g, ''); + src.replace(/(^|\n)[ \t]*(['"])use strict\2;?\s*/g, '$1').replace(/[ \t]*if\s*\(NODE\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '').replace(/[ \t]*if\s*\(typeof\s+module\s*!==\s*(['"])undefined\1\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '').replace(/[ \t]*[A-Za-z_][A-Za-z0-9_\.]*\.assert\([^\n]*\);[^\n]*/g, ''); } } } diff --git a/gulpfile.js b/gulpfile.js index 969b4d5ed..0d0cdcd0e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -71,7 +71,7 @@ gulp.task('mktmp', function() { .pipe(header('/* ' + file.path + ' */\n\n')) .pipe(replace(/(^|\n)[ \t]*(['"])use strict\2;?\s*/g, "$1")) .pipe(replace(/[ \t]*if\s*\(NODE\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, "")) - .pipe(replace(/[ \t]*if\s*\(typeof\s+module\s*!==\s*(['"])undefined\2\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, "")) + .pipe(replace(/[ \t]*if\s*\(typeof\s+module\s*!==\s*(['"])undefined\1\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, "")) .pipe(replace(/[ \t]*[A-Za-z_][A-Za-z0-9_.]*\.assert\([^\n]*\);[^\n]*/g, "")) })) .pipe(concat(pcX86ReleaseFile)) @@ -98,10 +98,9 @@ gulp.task('compile', function() { externs: [{src: 'var global; var resources;'}], // TODO: Can this refer to "externs.js" instead? warningLevel: 'VERBOSE', /* - * outputWrapper support was recently removed (without any obvious explanation), so we take care - * of it below, using the gulp-wrapper plug-in. + * outputWrapper support isn't available yet, so we take care of it below, using the gulp-wrapper plug-in. * - * outputWrapper: '(function(){\n%output%\n}).call(this)', + * outputWrapper: '(function(){%output%})()', */ jsOutputFile: pcX86ReleaseFile, // TODO: This must vary according to debugger/non-debugger releases createSourceMap: false