diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-01-15 11:29:08 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-01-15 11:29:08 -0800 |
commit | 8f2f40679dc21e9d878aaed45fe9dc9d404073d0 (patch) | |
tree | c894fb248febd9b87e43bbd9cf6b988e89248744 /js/lib/node.js | |
parent | a7b27f8ee13f54979d71d961457fc187c9626387 (diff) |
Added getType(), setType() to node.js.
Use these instead of direct property access.
This is the first step in a general move towards an API
like the one libcmark has. This will allow us to have a stable
API that is independent of details of the AST.
Diffstat (limited to 'js/lib/node.js')
-rw-r--r-- | js/lib/node.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/js/lib/node.js b/js/lib/node.js index 0c5bcee..12bb89e 100644 --- a/js/lib/node.js +++ b/js/lib/node.js @@ -89,6 +89,14 @@ Node.prototype.isContainer = function() { return isContainer(this); }; +Node.prototype.getType = function() { + return this.t; +} + +Node.prototype.setType = function(newtype) { + this.t = newtype; +} + Node.prototype.appendChild = function(child) { child.unlink(); child.parent = this; |