diff --git a/lib/sax.js b/lib/sax.js index ffd441a..28d0f55 100644 --- a/lib/sax.js +++ b/lib/sax.js @@ -621,13 +621,13 @@ // shorthand S = sax.STATE - function emit (parser, event, data) { - parser[event] && parser[event](data) + function emit (parser, event, ...data) { + parser[event] && parser[event](...data) } - function emitNode (parser, nodeType, data) { + function emitNode (parser, nodeType, ...data) { if (parser.textNode) closeText(parser) - emit(parser, nodeType, data) + emit(parser, nodeType, ...data) } function closeText (parser) { @@ -887,7 +887,7 @@ while (s-- > t) { var tag = parser.tag = parser.tags.pop() parser.tagName = parser.tag.name - emitNode(parser, 'onclosetag', parser.tagName) + emitNode(parser, 'onclosetag', parser.tagName, s > t) var x = {} for (var i in tag.ns) {