Remove auto with statement removal optimization from _.template. [closes #166]

Former-commit-id: da27942b109844d44327914631b7c5681489b04b
This commit is contained in:
John-David Dalton
2013-01-24 00:44:08 -08:00
parent 4c83435b4b
commit 641b6efe7f
7 changed files with 202 additions and 205 deletions

View File

@@ -1650,12 +1650,17 @@
'',
' text.replace(reDelimiters, function(match, escapeValue, interpolateValue, evaluateValue, offset) {',
' source += text.slice(index, offset).replace(reUnescapedString, escapeStringChar);',
' source +=',
' escapeValue ? "\' +\\n_.escape(" + escapeValue + ") +\\n\'" :',
' evaluateValue ? "\';\\n" + evaluateValue + ";\\n__p += \'" :',
' interpolateValue ? "\' +\\n((__t = (" + interpolateValue + ")) == null ? \'\' : __t) +\\n\'" : \'\';',
'',
' if (escapeValue) {',
' source += "\' +\\n_.escape(" + escapeValue + ") +\\n\'";',
' }',
' if (evaluateValue) {',
' source += "\';\\n" + evaluateValue + ";\\n__p += \'";',
' }',
' if (interpolateValue) {',
' source += "\' +\\n((__t = (" + interpolateValue + ")) == null ? \'\' : __t) +\\n\'";',
' }',
' index = offset + match.length;',
' return match;',
' });',
'',
' source += "\';\\n";',