[Pkg-javascript-commits] [ltx] 166/469: parse: emit error when tree was not complete

Jonas Smedegaard dr at jones.dk
Wed Aug 31 13:01:20 UTC 2016


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository ltx.

commit 6bb04d234e4400f5341ad99e8e474701fc9045d8
Author: Astro <astro at spaceboyz.net>
Date:   Mon Nov 22 01:20:38 2010 +0100

    parse: emit error when tree was not complete
---
 lib/parse.js | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/parse.js b/lib/parse.js
index ac2563a..d6b4fa3 100644
--- a/lib/parse.js
+++ b/lib/parse.js
@@ -50,8 +50,12 @@ exports.Parser.prototype.write = function(data) {
 exports.Parser.prototype.end = function() {
     if (!this.parser.parse('', true))
         this.emit('error', new Error(this.parser.getError()));
-    else
-        this.emit('tree', this.tree);
+    else {
+	if (this.tree)
+	    this.emit('tree', this.tree);
+	else
+	    this.emit('error', new Error('Incomplete document'));
+    }
 };
 
 exports.parse = function(data) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/ltx.git



More information about the Pkg-javascript-commits mailing list