From 9c52ecc19b35660d8c694917ddb2c1ecb4ca9327 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 17 Dec 2012 08:36:02 -0800 Subject: [PATCH] Tweak regexp in post-compile.js. Former-commit-id: 8c6933944703a17582696fb10b45f12926fe1030 --- build/post-compile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/post-compile.js b/build/post-compile.js index ebd80869d..6ea6cda9f 100644 --- a/build/post-compile.js +++ b/build/post-compile.js @@ -40,7 +40,7 @@ // flip `typeof` expressions to help optimize Safari and // correct the AMD module definition for AMD build optimizers // (e.g. from `"number" == typeof x` to `typeof x == "number") - source = source.replace(/(return)?\s*("[^"]+")\s*([!=]=)\s*(typeof(?:\s*\([^)]+\)|\s+[\w.]+))/g, function(match, ret, type, equality, expression) { + source = source.replace(/(return)?("[^"]+")\s*([!=]=)\s*(typeof(?:\s*\([^)]+\)|\s+[\w.]+))/g, function(match, ret, type, equality, expression) { return (ret ? ret + ' ' : '') + expression + equality + type; });