Fix closure compiler bug.

Former-commit-id: 6b61f095fa26d2dee0d70b666e630e4ca0fa7be6
This commit is contained in:
John-David Dalton
2013-01-16 23:59:24 -08:00
parent c9bec8e636
commit 96fbd7c7ba
3 changed files with 121 additions and 119 deletions

View File

@@ -31,7 +31,9 @@
source = source.replace(/^((?:(['"])use strict\2;)?(?:var (?:[a-z]+=(?:!0|!1|null)[,;])+)?)([\s\S]*?function[^)]+\){)/, '$3$1');
// correct overly aggressive Closure Compiler advanced optimizations
source = source.replace(/prototype\s*=\s*{\s*valueOf\s*:\s*1\s*}/, 'prototype={valueOf:1,y:1}');
source = source
.replace(/prototype\s*=\s*{\s*valueOf\s*:\s*1\s*}/, 'prototype={valueOf:1,y:1}')
.replace(/(document[^&]+&&)\s*\w+/, '$1!({toString:0}+"")');
// unescape properties (e.g. foo["bar"] => foo.bar)
source = source.replace(/(\w)\["([^."]+)"\]/g, function(match, left, right) {