From 0fa08a7f89aa199b9cbd7214cdfd890d209e2214 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 9 Jan 2015 12:49:07 -0800 Subject: Initialize more fields in Node. This helps with performance. --- js/lib/node.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/lib/node.js b/js/lib/node.js index befa93f..7e236d0 100644 --- 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]; -- cgit v1.2.3