diff options
Diffstat (limited to 'lib/sax.js')
-rw-r--r-- | lib/sax.js | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -70,6 +70,8 @@ function SAXParser (strict, opt) { // mostly just for error reporting parser.position = parser.line = parser.column = 0 emit(parser, "onready") + + return this; } function checkBufferLength (parser) { @@ -169,11 +171,14 @@ function SAXStream (strict, opt) { return me._parser["on"+ev] = h } me.on(ev, h) + return null; }, enumerable: true, configurable: false }) }) + + return this; } SAXStream.prototype = Object.create(Stream.prototype, @@ -572,7 +577,7 @@ function write (chunk) { "Cannot write after close. Assign an onready handler.") if (chunk === null) return end(parser) var i = 0, c = "" - while (parser.c = c = chunk.charAt(i++)) { + while ((parser.c = c = chunk.charAt(i++))) { parser.position ++ if (c === "\n") { parser.line ++ |