Bläddra i källkod

Don't compute object-ness all the time.

tags/0.5.0-vsc
thegrandpoobah 15 år sedan
förälder
incheckning
92643d9756
1 ändrade filer med 5 tillägg och 3 borttagningar
  1. +5
    -3
      mustache.js

+ 5
- 3
mustache.js Visa fil

@@ -755,8 +755,10 @@ var Mustache = function() {
var that = this; var that = this;
partials[key] = function(contextStack, send_func) { partials[key] = function(contextStack, send_func) {
var res = that.find_in_stack(key, contextStack);
if (that.is_object(res)) {
var res = that.find_in_stack(key, contextStack),
isObj = that.is_object(res);
if (isObj) {
contextStack.push(res); contextStack.push(res);
} }
@@ -764,7 +766,7 @@ var Mustache = function() {
commands[i](contextStack, send_func); commands[i](contextStack, send_func);
} }
if (that.is_object(res)) {
if (isObj) {
contextStack.pop(); contextStack.pop();
} }
}; };


Laddar…
Avbryt
Spara