[Pkg-javascript-commits] [node-expat] 203/371: Parser.end(): check for error to emit 'error'

Jonas Smedegaard dr at jones.dk
Sun Feb 28 10:00:05 UTC 2016


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

js pushed a commit to branch master
in repository node-expat.

commit 17f8dea934359a19a390e0d41dfaa016de1da059
Author: Astro <astro at spaceboyz.net>
Date:   Tue Oct 9 01:59:01 2012 +0200

    Parser.end(): check for error to emit 'error'
---
 lib/node-expat.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/node-expat.js b/lib/node-expat.js
index 45b4a1f..8fcf9eb 100644
--- a/lib/node-expat.js
+++ b/lib/node-expat.js
@@ -61,9 +61,11 @@ Parser.prototype.write = function(data) {
 };
 
 Parser.prototype.end = function(data) {
-    var error;
+    var error, result;
     try {
-	this.parse(data || "", true);
+	result = this.parse(data || "", true);
+	if (!result)
+	    error = this.getError();
     } catch (e) {
 	error = e;
     }

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



More information about the Pkg-javascript-commits mailing list