[Pkg-javascript-commits] [node-expat] 11/34: delint

Jonas Smedegaard dr at jones.dk
Wed Aug 31 10:46:48 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 d5f8931b880b93080b156b8e569095278bcbdafe
Author: Astro <astro at spaceboyz.net>
Date:   Sun May 8 15:53:11 2016 +0200

    delint
    
    according to `standard'
---
 benchmark.js  |  4 ++--
 test/index.js | 35 ++++++++++++++++++-----------------
 2 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/benchmark.js b/benchmark.js
index 19528ab..dc36cef 100644
--- a/benchmark.js
+++ b/benchmark.js
@@ -1,14 +1,14 @@
 'use strict'
 
 var benchmark = require('benchmark')
-var node_xml = require('node-xml')
+var nodeXml = require('node-xml')
 var libxml = require('libxmljs')
 var expat = require('./')
 var sax = require('sax')
 var LtxSaxParser = require('ltx/lib/parsers/ltx')
 
 function NodeXmlParser () {
-  var parser = new node_xml.SaxParser(function (cb) {})
+  var parser = new nodeXml.SaxParser(function (cb) {})
   this.parse = function (s) {
     parser.parseString(s)
   }
diff --git a/test/index.js b/test/index.js
index 5e306bc..325a2cc 100644
--- a/test/index.js
+++ b/test/index.js
@@ -6,6 +6,7 @@ var Buffer = require('buffer').Buffer
 var vows = require('vows')
 var assert = require('assert')
 var fs = require('fs')
+var path = require('path')
 var log = require('debug')('test/index')
 
 function collapseTexts (evs) {
@@ -28,43 +29,43 @@ function collapseTexts (evs) {
   return r
 }
 
-function expect (s, evs_expected) {
+function expect (s, evsExpected) {
   for (var step = s.length; step > 0; step--) {
-    expectWithParserAndStep(s, evs_expected, new expat.Parser(), step)
+    expectWithParserAndStep(s, evsExpected, new expat.Parser(), step)
   }
 }
 
-function expectWithParserAndStep (s, evs_expected, p, step) {
-  var evs_received = []
+function expectWithParserAndStep (s, evsExpected, p, step) {
+  var evsReceived = []
   p.addListener('startElement', function (name, attrs) {
-    evs_received.push(['startElement', name, attrs])
+    evsReceived.push(['startElement', name, attrs])
   })
   p.addListener('endElement', function (name) {
-    evs_received.push(['endElement', name])
+    evsReceived.push(['endElement', name])
   })
   p.addListener('text', function (s) {
-    evs_received.push(['text', s])
+    evsReceived.push(['text', s])
   })
   p.addListener('processingInstruction', function (target, data) {
-    evs_received.push(['processingInstruction', target, data])
+    evsReceived.push(['processingInstruction', target, data])
   })
   p.addListener('comment', function (s) {
-    evs_received.push(['comment', s])
+    evsReceived.push(['comment', s])
   })
   p.addListener('xmlDecl', function (version, encoding, standalone) {
-    evs_received.push(['xmlDecl', version, encoding, standalone])
+    evsReceived.push(['xmlDecl', version, encoding, standalone])
   })
   p.addListener('startCdata', function () {
-    evs_received.push(['startCdata'])
+    evsReceived.push(['startCdata'])
   })
   p.addListener('endCdata', function () {
-    evs_received.push(['endCdata'])
+    evsReceived.push(['endCdata'])
   })
   p.addListener('entityDecl', function (entityName, isParameterEntity, value, base, systemId, publicId, notationName) {
-    evs_received.push(['entityDecl', entityName, isParameterEntity, value, base, systemId, publicId, notationName])
+    evsReceived.push(['entityDecl', entityName, isParameterEntity, value, base, systemId, publicId, notationName])
   })
   p.addListener('error', function (e) {
-    evs_received.push(['error', e])
+    evsReceived.push(['error', e])
   })
   for (var l = 0; l < s.length; l += step) {
     var end = l + step
@@ -75,8 +76,8 @@ function expectWithParserAndStep (s, evs_expected, p, step) {
     p.write(s.slice(l, end))
   }
 
-  var expected = JSON.stringify(evs_expected)
-  var received = JSON.stringify(collapseTexts(evs_received))
+  var expected = JSON.stringify(evsExpected)
+  var received = JSON.stringify(collapseTexts(evsReceived))
   assert.equal(received, expected)
 }
 
@@ -404,7 +405,7 @@ vows.describe('node-expat').addBatch({
           assert.fail('Error', error)
         })
 
-        var mystic = fs.createReadStream(__dirname + '/mystic-library.xml')
+        var mystic = fs.createReadStream(path.join(__dirname, 'mystic-library.xml'))
         mystic.pipe(p)
       },
       'startElement and endElement events': function () {

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