- Commit
- 0fa08a7f89aa199b9cbd7214cdfd890d209e2214
- Parent
- 1446dc2c02a73abeeafbb431fea2cabda444a1cb
- Author
- John MacFarlane <jgm@berkeley.edu>
- Date
Initialize more fields in Node.
This helps with performance.
My personal build of CMark ✏️
Initialize more fields in Node.
This helps with performance.
1 file changed, 5 insertions, 2 deletions
Status | File Name | N° Changes | Insertions | Deletions |
Modified | js/lib/node.js | 7 | 5 | 2 |
diff --git a/js/lib/node.js b/js/lib/node.js @@ -72,6 +72,10 @@ function Node(nodeType, pos) { this.open = true; this.strings = []; this.string_content = ""; + this.c = undefined; + this.list_data = undefined; + this.tight = undefined; + this.info = undefined; } Node.prototype.isContainer = function() { @@ -159,8 +163,7 @@ Node.prototype.toAST = function() { var result = { t: this.t }; var propsToShow = ['t', 'c', 'list_data', 'string_content', - 'pos', 'start_column', 'end_column', - 'tight', 'info']; + 'pos', 'tight', 'info']; for (var i = 0; i < propsToShow.length; i++) { var prop = propsToShow[i];