Refactor previous commit.

Former-commit-id: ad5408ad8a9e5b2caa9667994fe6748760b40fbe
This commit is contained in:
John-David Dalton
2012-12-17 00:38:49 -08:00
parent 73d95de122
commit 3ef51d7fae
4 changed files with 59 additions and 61 deletions

View File

@@ -2088,12 +2088,6 @@
'isTemplate': isTemplate,
'outputPath': outputPath,
'onComplete': function(source) {
// replace `!1` with `false` and `!0` with `true` to help
// optimize Safari when used in a loop
source = source
.replace(/!1([!=]==?[a-z])/g, 'false$1')
.replace(/!0([!=]==?[a-z])/g, 'true$1')
// inject "use strict" directive
if (isStrict) {
source = source.replace(/^([\s\S]*?function[^{]+{)([^"'])/, '$1"use strict";$2');