aboutsummaryrefslogtreecommitdiff
path: root/lib/run.js
diff options
context:
space:
mode:
authorBen Burwell <ben.burwell@trifecta.com>2016-09-14 12:30:04 -0400
committerBen Burwell <ben.burwell@trifecta.com>2016-09-14 12:30:04 -0400
commitfd5817a6bb3185314540825e3d665e94ffe188c0 (patch)
tree9b35138a18122ebfcb5cfa41ac0eadd27cb2c002 /lib/run.js
Initial commit
Diffstat (limited to 'lib/run.js')
-rw-r--r--lib/run.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/run.js b/lib/run.js
new file mode 100644
index 0000000..92441a2
--- /dev/null
+++ b/lib/run.js
@@ -0,0 +1,20 @@
+(function() {
+ var evaluate = function(node, context) {
+ if (typeof context === 'undefined') {
+ context = {};
+ }
+ return statementEvaluators[node.className](node.dataset, node.children, context);
+ };
+
+ var statementEvaluators = getStatementEvaluators(evaluate);
+
+ document.addEventListener('DOMContentLoaded', function() {
+ var t0 = performance.now();
+ evaluate(document.body.children[0]);
+ var t1 = performance.now();
+ makeReadable(document.body);
+ var t2 = performance.now();
+ console.debug('Evaluated in ' + (t1 - t0) + 'ms');
+ console.debug('Rendered in ' + (t2 - t1) + 'ms');
+ });
+})();