summaryrefslogtreecommitdiff
path: root/js/lib/blocks.js
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-01-13 22:51:51 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2015-01-13 22:54:21 -0800
commit9fbc6267a4f6cd87c92fa6f57f437aacbac4fb72 (patch)
treedd80aa7af9614a75869102710022e8f7d2562b0a /js/lib/blocks.js
parentdaf49a0089b9f5e342d3f6ee077d7e284eeb5c1c (diff)
Initialize fields in objects to null rather than undefined.
Big speed boost.
Diffstat (limited to 'js/lib/blocks.js')
-rw-r--r--js/lib/blocks.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/js/lib/blocks.js b/js/lib/blocks.js
index d53a82f..cb4bd5f 100644
--- a/js/lib/blocks.js
+++ b/js/lib/blocks.js
@@ -161,7 +161,7 @@ var addChild = function(tag, offset) {
var column_number = offset + 1; // offset 0 = column 1
var newBlock = new Node(tag, [[this.lineNumber, column_number], [0, 0]]);
newBlock.strings = [];
- newBlock.string_content = undefined;
+ newBlock.string_content = null;
this.tip.appendChild(newBlock);
this.tip = newBlock;
return newBlock;
@@ -173,12 +173,12 @@ var parseListMarker = function(ln, offset, indent) {
var rest = ln.slice(offset);
var match;
var spaces_after_marker;
- var data = { type: undefined,
+ var data = { type: null,
tight: true,
- bullet_char: undefined,
- start: undefined,
- delimiter: undefined,
- padding: undefined,
+ bullet_char: null,
+ start: null,
+ delimiter: null,
+ padding: null,
marker_offset: indent };
if (rest.match(reHrule)) {
return null;
@@ -654,7 +654,7 @@ var processInlines = function(block) {
var Document = function() {
var doc = new Node('Document', [[1, 1], [0, 0]]);
- doc.string_content = undefined;
+ doc.string_content = null;
doc.strings = [];
return doc;
};