[Pkg-javascript-commits] [node-expat] 128/371: Imported Upstream version 1.4.3

Jonas Smedegaard dr at jones.dk
Sun Feb 28 09:59:54 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 75414cffaecb9a541c9761bf6dd247f581acbc52
Author: Jonas Smedegaard <dr at jones.dk>
Date:   Thu Mar 1 20:25:24 2012 +0100

    Imported Upstream version 1.4.3
---
 .travis.yml   |  4 ++++
 bench.js      | 28 ++++++++++++++++++++++++----
 node-expat.cc |  2 +-
 package.json  | 27 ++++++++++++++-------------
 test.js       |  5 ++---
 5 files changed, 45 insertions(+), 21 deletions(-)

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..f1d0f13
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+  - 0.4
+  - 0.6
diff --git a/bench.js b/bench.js
index ce282a1..c7e74a9 100644
--- a/bench.js
+++ b/bench.js
@@ -1,7 +1,8 @@
-var sys = require('sys');
+var util = require('util');
 var node_xml = require("node-xml");
 var libxml = require("libxmljs");
-var expat = require('./lib/node-expat');
+var expat = require('node-expat');
+var sax = require('sax');
 
 function NodeXmlParser() {
     var parser = new node_xml.SaxParser(function(cb) { });
@@ -15,6 +16,12 @@ function LibXmlJsParser() {
 	parser.push(s, false);
     };
 }
+function SaxParser() {
+    var parser = sax.parser();
+	this.parse = function(s) {
+	parser.write(s).close();
+	}
+}
 function ExpatParser() {
     var parser = new expat.Parser();
     this.parse = function(s) {
@@ -24,6 +31,7 @@ function ExpatParser() {
 
 //var p = new NodeXmlParser();
 //var p = new LibXmlJsParser();
+//var p = new SaxParser();
 var p = new ExpatParser();
 p.parse("<r>");
 var nEl = 0;
@@ -34,7 +42,19 @@ function d() {
 }
 d();
 
+var its =[];
 setInterval(function() {
-    sys.puts(nEl + " el/s");
+    util.puts(nEl + " el/s");
+	its.push(nEl);
     nEl = 0;
-}, 1000);
\ No newline at end of file
+}, 1000);
+
+process.on('SIGINT', function () {
+	var average = 0;
+	its.forEach(function (v){
+		average += v;
+	});
+	average /= its.length;
+	util.puts("Average: " + average + " el/s");
+	process.exit(0);
+});
\ No newline at end of file
diff --git a/node-expat.cc b/node-expat.cc
index 6243f07..35b39be 100644
--- a/node-expat.cc
+++ b/node-expat.cc
@@ -351,7 +351,7 @@ private:
     Handle<Value> argv[8] = { sym_entityDecl,
                               entityName ? String::New(entityName) : Null(),
                               Boolean::New(is_parameter_entity),
-                              value ? String::New(value) : Null(),
+                              value ? String::New(value, value_length) : Null(),
                               base ? String::New(base) : Null(),
                               systemId ? String::New(systemId) : Null(),
                               publicId ? String::New(publicId) : Null(),
diff --git a/package.json b/package.json
index 031ff69..f97163e 100644
--- a/package.json
+++ b/package.json
@@ -1,23 +1,24 @@
 { "name": "node-expat"
-,"version": "1.4.1"
+,"version": "1.4.3"
 ,"main": "./lib/node-expat"
 ,"description": "NodeJS binding for fast XML parsing."
+,"keywords": ["xml","sax","expat","libexpat","parse","parsing"]
 ,"scripts" : { "install": "node-waf configure build"
 	      ,"update": "node-waf build"
-	      ,"test": "node test.js"
+	      ,"test": "vows --spec ./test.js"
 	     }
-,"dependencies": []
-,"devDependencies": ["vows"]
-,"repositories": [{ "type": "git"
-		   ,"path": "git://github.com/astro/node-expat.git"
-		  }]
+,"dependencies": {}
+,"devDependencies": {"vows": ">=0.5.12"}
+,"repository": { "type": "git"
+	       , "path": "git://github.com/astro/node-expat.git"
+	       }
 ,"homepage": "http://github.com/astro/node-expat"
 ,"bugs": "http://github.com/astro/node-expat/issues"
-,"maintainers": [{ "name": "Astro"
-		  ,"email": "astro at spaceboyz.net"
-		  ,"web": "http://spaceboyz.net/~astro/"
-		 }]
-,"contributors": ["Stephan Maka", "Derek Hammer", "Iein Valdez", "Peter Körner", "Camilo Aguilar"]
+,"author": { "name": "Astro"
+	   , "email": "astro at spaceboyz.net"
+	   , "web": "http://spaceboyz.net/~astro/"
+	   }
+,"contributors": ["Stephan Maka", "Derek Hammer", "Iein Valdez", "Peter Körner", "Camilo Aguilar", "Michael Weibel"]
 ,"licenses": [{ "type": "MIT" }]
-,"engine": "node"
+,"engines": { "node": ">=0.4" }
 }
diff --git a/test.js b/test.js
index d1dfe7f..1508407 100644
--- a/test.js
+++ b/test.js
@@ -1,4 +1,3 @@
-var sys = require('sys');
 var expat = require('./lib/node-expat');
 var Buffer = require('buffer').Buffer;
 var vows = require('vows');
@@ -248,7 +247,7 @@ vows.describe('node-expat').addBatch({
            var result2 = p.parse(xml);
            assert.isNull(p.getError());
            assert.ok(result2);
-            
+
         }*/
     }
-}).run();
+}).export(module);

-- 
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