[Pkg-javascript-commits] [ltx] 313/469: easysax cleaned up
Jonas Smedegaard
dr at jones.dk
Wed Aug 31 13:03: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 71ef677cdc09ddc02a6f28932dbbb2495959554b
Author: Lloyd Watkin <lloyd at evilprofessor.co.uk>
Date: Sun Feb 16 20:20:44 2014 +0000
easysax cleaned up
---
lib/sax/sax_easysax.js | 38 ++++++++++++++++++--------------------
1 file changed, 18 insertions(+), 20 deletions(-)
diff --git a/lib/sax/sax_easysax.js b/lib/sax/sax_easysax.js
index ed603ae..1a08e68 100644
--- a/lib/sax/sax_easysax.js
+++ b/lib/sax/sax_easysax.js
@@ -15,33 +15,34 @@ function SaxEasysax() {
events.EventEmitter.call(this)
this.parser = new Easysax()
- var that = this
+ var self = this
- this.parser.on('startNode', function(name, attr, uq, istagend) {
- attr = attr()
+ this.parser.on('startNode', function(name, attr, uq) {
+ attr = attr()
- if (attr === false) {
- that.emit('error', 'attr char')
- return false
- }
+ if (attr === false) {
+ self.emit('error', 'attr char')
+ return false
+ }
- for(var k in attr) {
- attr[k] = uq(attr[k])
- }
+ for(var k in attr) {
+ attr[k] = uq(attr[k])
+ }
- that.emit('startElement', name, attr)
+ self.emit('startElement', name, attr)
})
- this.parser.on('endNode', function(name, uq, str, tagstart) {
- that.emit('endElement', name)
+ /* jshint -W098 */
+ this.parser.on('endNode', function(name) {
+ self.emit('endElement', name)
})
this.parser.on('textNode', function(str, uq) {
- that.emit('text', uq(str))
+ self.emit('text', uq(str))
})
this.parser.on('cdata', function(str) {
- that.emit('text', str)
+ self.emit('text', str)
})
this.parser.on('error', function(e) {
- that.emit('error', e)
+ self.emit('error', e)
})
// TODO: other events, esp. entityDecl (billion laughs!)
@@ -56,7 +57,4 @@ function SaxEasysax() {
this.parser(sbuffer)
sbuffer = ''
}
-}
-
-
-
+}
\ No newline at end of file
--
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