Skip to content
Steven edited this page Apr 20, 2015 · 1 revision

Welcome to the tornado wiki!

To try out the compiler (after cloning the repo), run npm install, then run grunt, then runt node test.js from the project's root directory. The compiled output of the template defined in test.es6 will be output in the terminal (as well as some debugging information.

The Torndao run time hasn't been written yet, so to get the code to actually work in a browser, you need to create a mock runtime environment. Copy and paste the code below into the developer tools console:

var td = {
  register: function() {},
  get: function(c, path) {
    return 'this was {' + path.join() + '}';
  }
};

Node.prototype.replaceChildAtIdx = function(idx, newChild) {
  var refNode = this.childNodes[idx];
  if (refNode) {
    this.replaceChild(newChild, refNode);
  } else if (idx >= this.childNodes.length) {
    this.appendChild(newChild);
  }
};
Clone this wiki locally