Explorar el Código

Conditional Ternary at some points

pull/551/head
Andre Nardy hace 10 años
padre
commit
588320222f
Se han modificado 1 ficheros con 3 adiciones y 11 borrados
  1. +3
    -11
      mustache.js

+ 3
- 11
mustache.js Ver fichero

@@ -525,11 +525,7 @@
// Extract the portion of the original template that the section contains.
value = value.call(context.view, originalTemplate.slice(token[3], token[5]), subRender);

if (value != null)
buffer += value;
} else {
buffer += this.renderTokens(token[4], context, partials, originalTemplate);
}
buffer += (value != null) ? value : this.renderTokens(token[4], context, partials, originalTemplate);
return buffer;
};

@@ -551,15 +547,11 @@
};

Writer.prototype.unescapedValue = function unescapedValue (token, context) {
var value = context.lookup(token[1]);
if (value != null)
return value;
return (value != null) ? value : context.lookup(token[1]);
};

Writer.prototype.escapedValue = function escapedValue (token, context) {
var value = context.lookup(token[1]);
if (value != null)
return mustache.escape(value);
return (value != null) ? mustache.escape(value) : context.lookup(token[1]);
};

Writer.prototype.rawValue = function rawValue (token) {


Cargando…
Cancelar
Guardar