Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

IE...

  • Loading branch information...
commit e1a7b64cd854f27a764c12698f00b489638acbad 1 parent 48603e9
@olado authored
Showing with 6 additions and 6 deletions.
  1. +1 −1  benchmarks/templating/doT.js
  2. +1 −1  doT.js
  3. +4 −4 doT.min.js
View
2  benchmarks/templating/doT.js
@@ -80,7 +80,7 @@
if (c.use || c.define) {
var olddef = global.def; global.def = def || {}; // workaround minifiers
str = resolveDefs(c, tmpl, global.def);
- if (olddef) global.def = olddef; else delete global.def;
+ global.def = olddef;
} else str = tmpl;
str = ("var out='" + ((c.strip) ? str.replace(/\s*<!\[CDATA\[\s*|\s*\]\]>\s*|[\r\n\t]|(\/\*[\s\S]*?\*\/)/g, ''): str)
View
2  doT.js
@@ -80,7 +80,7 @@
if (c.use || c.define) {
var olddef = global.def; global.def = def || {}; // workaround minifiers
str = resolveDefs(c, tmpl, global.def);
- if (olddef) global.def = olddef; else delete global.def;
+ global.def = olddef;
} else str = tmpl;
str = ("var out='" + ((c.strip) ? str.replace(/\s*<!\[CDATA\[\s*|\s*\]\]>\s*|[\r\n\t]|(\/\*[\s\S]*?\*\/)/g, ''): str)
View
8 doT.min.js
@@ -1,5 +1,5 @@
-(function(){function m(b,a,e){return(typeof a==="string"?a:a.toString()).replace(b.define,function(f,c,g,k){if(c.indexOf("def.")===0)c=c.substring(4);if(!(c in e))if(g===":")e[c]=k;else eval("def['"+c+"']="+k);return""}).replace(b.use,function(f,c){var g=eval(c);return g?m(b,g,e):g})}function j(b){return b.replace(/\\'/g,"'").replace(/\\\\/g,"\\").replace(/[\r\t\n]/g," ")}function n(){var b={"&":"&#38;","<":"&#60;",">":"&#62;",'"':"&#34;","'":"&#39;","/":"&#47;"},a=/&(?!\\w+;)|<|>|\"|'|\//g;return function(e){return e?
-e.toString().replace(a,function(f){return b[f]||f}):e}}var h={version:"0.2.0"},i=function(){return this||(0,eval)("this")}();if(typeof module!=="undefined"&&module.exports)module.exports=h;else if(typeof define==="function"&&define.amd)define(function(){return h});else i.doT=h;h.templateSettings={evaluate:/\{\{([\s\S]+?)\}\}/g,interpolate:/\{\{=([\s\S]+?)\}\}/g,encode:/\{\{!([\s\S]+?)\}\}/g,use:/\{\{#([\s\S]+?)\}\}/g,define:/\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g,conditionalStart:/\{\{\?([\s\S]+?)\}\}/g,
-conditionalElse:/\{\{\?\?\s*([\s\S]*?)\s*\}\}/g,conditionalEnd:/\{\{\?\}\}/g,varname:"it",strip:true,append:true,selfcontained:false};i.encodeHTML=n();var o={append:{start:"'+(",end:")+'",startencode:"'+encodeHTML("},split:{start:"';out+=(",end:");out+='",startencode:"';out+=encodeHTML("}};h.template=function(b,a,e){a=a||h.templateSettings;var f=a.append?o.append:o.split,c;if(a.use||a.define){var g=i.def;i.def=e||{};b=m(a,b,i.def);if(g)i.def=g;else delete i.def}b=("var out='"+(a.strip?b.replace(/\s*<!\[CDATA\[\s*|\s*\]\]>\s*|[\r\n\t]|(\/\*[\s\S]*?\*\/)/g,
+(function(){function m(b,a,e){return(typeof a==="string"?a:a.toString()).replace(b.define,function(f,c,h,k){if(c.indexOf("def.")===0)c=c.substring(4);if(!(c in e))if(h===":")e[c]=k;else eval("def['"+c+"']="+k);return""}).replace(b.use,function(f,c){var h=eval(c);return h?m(b,h,e):h})}function j(b){return b.replace(/\\'/g,"'").replace(/\\\\/g,"\\").replace(/[\r\t\n]/g," ")}function n(){var b={"&":"&#38;","<":"&#60;",">":"&#62;",'"':"&#34;","'":"&#39;","/":"&#47;"},a=/&(?!\\w+;)|<|>|\"|'|\//g;return function(e){return e?
+e.toString().replace(a,function(f){return b[f]||f}):e}}var g={version:"0.2.0"},i=function(){return this||(0,eval)("this")}();if(typeof module!=="undefined"&&module.exports)module.exports=g;else if(typeof define==="function"&&define.amd)define(function(){return g});else i.doT=g;g.templateSettings={evaluate:/\{\{([\s\S]+?)\}\}/g,interpolate:/\{\{=([\s\S]+?)\}\}/g,encode:/\{\{!([\s\S]+?)\}\}/g,use:/\{\{#([\s\S]+?)\}\}/g,define:/\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g,conditionalStart:/\{\{\?([\s\S]+?)\}\}/g,
+conditionalElse:/\{\{\?\?\s*([\s\S]*?)\s*\}\}/g,conditionalEnd:/\{\{\?\}\}/g,varname:"it",strip:true,append:true,selfcontained:false};i.encodeHTML=n();var o={append:{start:"'+(",end:")+'",startencode:"'+encodeHTML("},split:{start:"';out+=(",end:");out+='",startencode:"';out+=encodeHTML("}};g.template=function(b,a,e){a=a||g.templateSettings;var f=a.append?o.append:o.split,c;if(a.use||a.define){var h=i.def;i.def=e||{};b=m(a,b,i.def);i.def=h}b=("var out='"+(a.strip?b.replace(/\s*<!\[CDATA\[\s*|\s*\]\]>\s*|[\r\n\t]|(\/\*[\s\S]*?\*\/)/g,
""):b).replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(a.interpolate,function(l,d){return f.start+j(d)+f.end}).replace(a.encode,function(l,d){c=true;return f.startencode+j(d)+f.end}).replace(a.conditionalEnd,"';}out+='").replace(a.conditionalElse,function(l,d){return d?"';}else if("+j(d)+"){out+='":"';}else{out+='"}).replace(a.conditionalStart,function(l,d){return"';if("+j(d)+"){out+='"}).replace(a.evaluate,function(l,d){return"';"+j(d)+"out+='"})+"';return out;").replace(/\n/g,"\\n").replace(/\t/g,
-"\\t").replace(/\r/g,"\\r").split("out+='';").join("").split("var out='';out+=").join("var out=");if(c&&a.selfcontained)b="var encodeHTML=("+n.toString()+"());"+b;try{return new Function(a.varname,b)}catch(k){typeof console!=="undefined"&&console.log("Could not create a template function: "+b);throw k;}};h.compile=function(b,a){return h.template(b,null,a)}})();
+"\\t").replace(/\r/g,"\\r").split("out+='';").join("").split("var out='';out+=").join("var out=");if(c&&a.selfcontained)b="var encodeHTML=("+n.toString()+"());"+b;try{return new Function(a.varname,b)}catch(k){typeof console!=="undefined"&&console.log("Could not create a template function: "+b);throw k;}};g.compile=function(b,a){return g.template(b,null,a)}})();
Please sign in to comment.
Something went wrong with that request. Please try again.