From 47b51c22faf86e16f6c42be91e92005668881f32 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 14 Aug 2012 02:36:55 -0700 Subject: [PATCH] Ensure build tweaks are applied when new lines break up specific patterns. Former-commit-id: 085a837521750457db9f20f3701984cba24a4f4f --- build.js | 2 +- build/post-compile.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.js b/build.js index 5e4bd287c..8be41afc6 100755 --- a/build.js +++ b/build.js @@ -691,7 +691,7 @@ */ function writeFile(source, filename) { // correct overly aggressive Closure Compiler minification - source = source.replace('prototype={valueOf:1}', 'prototype={valueOf:1,y:1}'); + source = source.replace(/prototype\s*=\s*{\s*valueOf\s*:\s*1\s*}/, 'prototype={valueOf:1,y:1}'); // re-remove "use strict" added by the minifier if (!useStrict) { diff --git a/build/post-compile.js b/build/post-compile.js index 2db173227..4bd6d1999 100644 --- a/build/post-compile.js +++ b/build/post-compile.js @@ -38,7 +38,7 @@ source = source.replace(/(\w)\["([^."]+)"\]/g, '$1.$2'); // correct AMD module definition for AMD build optimizers - source = source.replace(/("function")==(typeof define)&&\(?("object")==(typeof define\.amd)(&&define\.amd)\)?/, '$2==$1&&$4==$3$5'); + source = source.replace(/("function")\s*==\s*(typeof define)\s*&&\s*\(?\s*("object")\s*==\s*(typeof define\.amd)\s*&&\s*(define\.amd)\s*\)?/, '$2==$1&&$4==$3&&$5'); // add license source = license + '\n;' + source;