Tweak regexp in post-compile.js.

Former-commit-id: 8c6933944703a17582696fb10b45f12926fe1030
This commit is contained in:
John-David Dalton
2012-12-17 08:36:02 -08:00
parent 692c884ca2
commit e5b8af8193

View File

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