Introduced new Dependency() class to encapsulate dependency handling logic

Note that the format is now slightly different; see js/Dependencies.js
for details
This commit is contained in:
Jeremy Ruston
2012-02-17 14:11:25 +00:00
parent 8d4d168432
commit 103a9a4d7f
11 changed files with 87 additions and 80 deletions

View File

@@ -11,6 +11,7 @@ Compiles JSON objects into JavaScript functions that render them in HTML and pla
var WikiTextParseTree = require("./WikiTextParseTree.js").WikiTextParseTree,
Renderer = require("./Renderer.js").Renderer,
Dependencies = require("./Dependencies.js").Dependencies,
utils = require("./Utils.js");
var renderObject = function(obj) {
@@ -43,7 +44,7 @@ var JSONParser = function(options) {
};
JSONParser.prototype.parse = function(type,text) {
return new WikiTextParseTree([renderObject(JSON.parse(text))],{},this.store);
return new WikiTextParseTree([renderObject(JSON.parse(text))],new Dependencies(),this.store);
};
exports.JSONParser = JSONParser;