Skip to content

Instantly share code, notes, and snippets.

@paularmstrong
Last active December 20, 2015 10:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paularmstrong/6114594 to your computer and use it in GitHub Desktop.
Save paularmstrong/6114594 to your computer and use it in GitHub Desktop.
Swig:Next benchmarking
function anonymous(_swig,_ctx,_filters,_,_fn) {
var _output = "";
_output += _filters["e"]((((typeof obj !== "undefined" && obj.hasOwnProperty("a")) ? ((typeof obj !== "undefined" && obj.hasOwnProperty("a")) ? obj.a : "") : ((typeof _ctx.obj !== "undefined" && _ctx.obj.hasOwnProperty("a")) ? _ctx.obj.a : ""))));
_output += "\n";
_output += _filters["e"]((((typeof obj !== "undefined") ? ((typeof obj !== "undefined") ? obj : "") : ((typeof _ctx.obj !== "undefined") ? _ctx.obj : ""))['b']));
_output += "\n";
return _output;
}
function anonymous(_context,_parents,_filters,_,_ext) {
_parents = _parents ? _parents.slice() : [];
_context = _context || {};
var j = _parents.length,
_output = "",
_this = this;
while (j--) {
if (_parents[j] === this.id) {
return "Circular import of template " + this.id + " in " + _parents[_parents.length-1];
}
}
_parents.push(this.id);
if (typeof _context !== "undefined" && typeof _context.obj_a === "function") {
_output = (typeof _output === "undefined") ? (function () {
return _context["obj_a"]();
})(): _output + (function () {
return _context["obj_a"]();
})();
} else if (typeof obj_a === "function") {
_output = (typeof _output === "undefined") ? (function () {
return obj_a();
})(): _output + (function () {
return obj_a();
})();
} else {
var __obj_a = "";
if ((typeof _context !== "undefined" && typeof _context.obj !== "undefined" && typeof _context.obj.a !== "undefined")) {
__obj_a = _filters.escape.call(this, (typeof _context.obj.a === 'function') ? _context.obj.a() : _context.obj.a, true);
} else if ((typeof obj !== "undefined" && typeof obj.a !== "undefined")) {
__obj_a = _filters.escape.call(this, (typeof obj.a === 'function') ? obj.a() : obj.a, true);
}
_output = (typeof _output === "undefined") ? __obj_a: _output + __obj_a;
}
_output += "\n";
if (typeof _context !== "undefined" && typeof _context.obj__b__ === "function") {
_output = (typeof _output === "undefined") ? (function () {
return _context["obj__b__"]();
})(): _output + (function () {
return _context["obj__b__"]();
})();
} else if (typeof obj__b__ === "function") {
_output = (typeof _output === "undefined") ? (function () {
return obj__b__();
})(): _output + (function () {
return obj__b__();
})();
} else {
var __obj__b__ = "";
if ((typeof _context !== "undefined" && typeof _context.obj !== "undefined" && typeof _context.obj['b'] !== "undefined")) {
__obj__b__ = _filters.escape.call(this, (typeof _context.obj['b'] === 'function') ? _context.obj['b']() : _context.obj['b'], true);
} else if ((typeof obj !== "undefined" && typeof obj['b'] !== "undefined")) {
__obj__b__ = _filters.escape.call(this, (typeof obj['b'] === 'function') ? obj['b']() : obj['b'], true);
}
_output = (typeof _output === "undefined") ? __obj__b__: _output + __obj__b__;
}
return _output;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment