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; });