Adding caching for tiddler parse trees, render functions, and renditions

This commit is contained in:
Jeremy Ruston
2012-01-06 17:40:22 +00:00
parent e190cadcca
commit 14243acec9
4 changed files with 36 additions and 16 deletions
+3
View File
@@ -22,6 +22,9 @@ var utils = require("./Utils.js"),
WikiTextParser = require("./WikiTextParser.js").WikiTextParser;
var Tiddler = function(/* tiddler,fields */) {
this.parseTree = null; // Caches the parse tree for the tiddler
this.renderers = {}; // Caches rendering functions for this tiddler (indexed by MIME type)
this.renditions = {}; // Caches the renditions produced by those functions (indexed by MIME type)
this.fields = {};
for(var c=0; c<arguments.length; c++) {
var arg = arguments[c],