[Pkg-javascript-commits] [ltx] 310/469: tabs -> spaces

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 73b653d2ba13e339358d63f857df0af82a551894
Author: Lloyd Watkin <lloyd at evilprofessor.co.uk>
Date:   Sun Feb 16 20:10:44 2014 +0000

    tabs -> spaces
---
 benchmark/benchmark.js  | 176 ++++++++++++++++++++++++------------------------
 lib/element.js          |  18 ++---
 lib/index.js            |   2 +-
 lib/parse.js            | 107 +++++++++++++++--------------
 lib/sax/sax_easysax.js  |  52 +++++++-------
 lib/sax/sax_expat.js    |   4 +-
 lib/sax/sax_ltx.js      |   2 +-
 lib/sax/sax_node-xml.js |  82 +++++++++++-----------
 lib/sax/sax_saxjs.js    |   2 +-
 test/parse-test.js      |  88 ++++++++++++------------
 10 files changed, 271 insertions(+), 262 deletions(-)

diff --git a/benchmark/benchmark.js b/benchmark/benchmark.js
index 3bcb968..46fc8a7 100644
--- a/benchmark/benchmark.js
+++ b/benchmark/benchmark.js
@@ -1,146 +1,146 @@
 'use strict';
 
 if (process.title === 'browser') {
-    var ltx = require("ltx");
-    var strophe = require('Strophe.js');
-    var requestAnimationFrame = require('request-animation-frame').requestAnimationFrame;
+    var ltx = require("ltx")
+    var strophe = require('Strophe.js')
+    var requestAnimationFrame = require('request-animation-frame').requestAnimationFrame
 } else {
-    var path = "../lib/index";
-    var ltx = require(path);
+    var path = "../lib/index"
+    var ltx = require(path)
 }
-var util = require('util');
+var util = require('util')
 
 function now() {
-    return new Date().getTime();
+    return new Date().getTime()
 }
 
 function Test() {
-    this.timings = {};
+    this.timings = {}
 }
 Test.prototype = {
     record: function(name, fun) {
-	var t1 = now();
-	var res = fun();
-	var t2 = now();
-
-	if (!this.timings.hasOwnProperty(name))
-	    this.timings[name] = { i: 0, t: 0 };
-	this.timings[name].i++;
-	this.timings[name].t += t2 - t1;
+    var t1 = now()
+    var res = fun()
+    var t2 = now()
+
+    if (!this.timings.hasOwnProperty(name))
+        this.timings[name] = { i: 0, t: 0 }
+    this.timings[name].i++
+    this.timings[name].t += t2 - t1
     },
 
     report: function() {
-	if (process.title === 'browser') {
-	    var s = [];
-	    var html = "<div style='float: left; min-width: 25em'><h2>" + this.name + "</h2><dl>";
-	    for(var k in this.timings) {
-		var t = this.timings[k].t / this.timings[k].i;
-		html += "<dt>" + k + "</dt><dd class='" + k + "'>" + t + " ms </dd>";
-	    }
-	    html += "</dl></div>\n";
-	    return html;
-	} else {
-	    var s = this.name + "\t";
-	    for(k in this.timings) {
-		var t = this.timings[k].t / this.timings[k].i;
-		s += k + ": " + t + " ms\t";
-	    }
-	    return s;
-	}
+    if (process.title === 'browser') {
+        var s = []
+        var html = "<div style='float: left min-width: 25em'><h2>" + this.name + "</h2><dl>"
+        for(var k in this.timings) {
+        var t = this.timings[k].t / this.timings[k].i
+        html += "<dt>" + k + "</dt><dd class='" + k + "'>" + t + " ms </dd>"
+        }
+        html += "</dl></div>\n"
+        return html
+    } else {
+        var s = this.name + "\t"
+        for(k in this.timings) {
+        var t = this.timings[k].t / this.timings[k].i
+        s += k + ": " + t + " ms\t"
+        }
+        return s
+    }
     }
-};
+}
 
 function LtxTest(saxParser) {
-    Test.call(this);
-    this.saxParser = saxParser;
-    this.name = "LTX/" + saxParser.name;
+    Test.call(this)
+    this.saxParser = saxParser
+    this.name = "LTX/" + saxParser.name
 }
-util.inherits(LtxTest, Test);
+util.inherits(LtxTest, Test)
 
 LtxTest.prototype.parse = function(s) {
-    return ltx.parse(s, this.saxParser);
-};
+    return ltx.parse(s, this.saxParser)
+}
 
 LtxTest.prototype.serialize = function(el) {
-    return el.toString();
-};
+    return el.toString()
+}
 
 LtxTest.prototype.traverse = function(node) {
     while(node.children && node.children[0])
-	node = node.children[0];
-};
+    node = node.children[0]
+}
 
 function StropheTest() {
-    Test.call(this);
+    Test.call(this)
 
-    this.serialize = Strophe.serialize;
+    this.serialize = Strophe.serialize
 }
-util.inherits(StropheTest, Test);
+util.inherits(StropheTest, Test)
 
-StropheTest.prototype.name = "Strophe.js";
+StropheTest.prototype.name = "Strophe.js"
 
 StropheTest.prototype.parse = function(s) {
-    return Strophe.xmlHtmlNode(s).firstChild;
-};
+    return Strophe.xmlHtmlNode(s).firstChild
+}
 
 StropheTest.prototype.traverse = function(node) {
     while(node.firstChild)
-	node = node.firstChild;
-};
+    node = node.firstChild
+}
 
 var tests = ltx.availableSaxParsers.map(function(saxParser) {
-    return new LtxTest(saxParser);
-});
+    return new LtxTest(saxParser)
+})
 if (process.title === 'browser')
-    tests.push(new StropheTest());
+    tests.push(new StropheTest())
 var messages = [
     "<message/>",
     "<message foo='bar'/>",
     "<message foo='bar'><foo/><bar>fnord<baz/>fnord</bar></message>"
-];
-messages[3] = "<message>";
+]
+messages[3] = "<message>"
 for(var i = 0; i < 10; i++) {
-    messages[3] += "fnord fnord fnord<foo bar='baz'>";
+    messages[3] += "fnord fnord fnord<foo bar='baz'>"
 }
 for(var i = 0; i < 10; i++) {
-    messages[3] += "</foo>fnordfnordfnordfnord<quux foo='bar'/>";
+    messages[3] += "</foo>fnordfnordfnordfnord<quux foo='bar'/>"
 }
-messages[3] += "</message>";
+messages[3] += "</message>"
 
-var iteration = 0;
+var iteration = 0
 function runTests() {
-    iteration++;
+    iteration++
     tests.forEach(function(test) {
-	for(var j = 0; j < messages.length; j++) {
-	    var parsed, serialized;
-	    test.record('parse' + j, function() {
-		parsed = test.parse(messages[j]);
-	    });
-	    test.record('serialize' + j, function() {
-		serialized = test.serialize(parsed);
-	    });
-	    test.record('traverse' + j, function() {
-		test.traverse(parsed);
-	    });
-	}
-    });
+    for(var j = 0; j < messages.length; j++) {
+        var parsed, serialized
+        test.record('parse' + j, function() {
+        parsed = test.parse(messages[j])
+        })
+        test.record('serialize' + j, function() {
+        serialized = test.serialize(parsed)
+        })
+        test.record('traverse' + j, function() {
+        test.traverse(parsed)
+        })
+    }
+    })
 
     if (process.title === 'browser') {
-	document.body.innerHTML = "<style>.parse0, .parse1, .parse2, .parse3 { color: red; } .serialize1, .serialize2, .serialize3, .serialize4 { color: blue; }</style>\n" +
-	    "<h1>Iteration " + iteration + "<h1>\n";
-	tests.forEach(function(test) {
-	    document.body.innerHTML += test.report() + "<br>";
-	});
-	requestAnimationFrame(runTests);
+    document.body.innerHTML = "<style>.parse0, .parse1, .parse2, .parse3 { color: red; } .serialize1, .serialize2, .serialize3, .serialize4 { color: blue; }</style>\n" +
+        "<h1>Iteration " + iteration + "<h1>\n"
+    tests.forEach(function(test) {
+        document.body.innerHTML += test.report() + "<br>"
+    })
+    requestAnimationFrame(runTests)
     } else {
-	console.log("Iteration " + iteration);
-	tests.forEach(function(test) {
-	    console.log(test.report());
-	});
-	process.nextTick(runTests);
+    console.log("Iteration " + iteration)
+    tests.forEach(function(test) {
+        console.log(test.report())
+    })
+    process.nextTick(runTests)
     }
 }
 
 setTimeout(function() {
-    runTests();
-}, 1000);
+    runTests()
+}, 1000)
diff --git a/lib/element.js b/lib/element.js
index 790e79e..29fe252 100644
--- a/lib/element.js
+++ b/lib/element.js
@@ -292,15 +292,15 @@ Element.prototype.write = function(writer) {
     writer(this.name)
     for (var k in this.attrs) {
         var v = this.attrs[k]
-    if (v || (v === '') || (v === 0)) {
-        writer(' ')
-            writer(k)
-            writer('="')
-            if (typeof v !== 'string')
-        v = v.toString(10)
-            writer(escapeXml(v))
-            writer('"')
-    }
+        if (v || (v === '') || (v === 0)) {
+            writer(' ')
+                writer(k)
+                writer('="')
+                if (typeof v !== 'string')
+            v = v.toString(10)
+                writer(escapeXml(v))
+                writer('"')
+        }
     }
     if (this.children.length === 0) {
         writer('/>')
diff --git a/lib/index.js b/lib/index.js
index 334afe9..b41e7d0 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -22,4 +22,4 @@ exports.Parser = parse.Parser
  * SAX parser interface
  */
 exports.availableSaxParsers = parse.availableSaxParsers
-exports.bestSaxParser = parse.bestSaxParser
+exports.bestSaxParser = parse.bestSaxParser
\ No newline at end of file
diff --git a/lib/parse.js b/lib/parse.js
index 5ebfa00..b11d41d 100644
--- a/lib/parse.js
+++ b/lib/parse.js
@@ -3,97 +3,106 @@
 var events = require('events')
   , util = require('util')
 
-exports.availableSaxParsers = [];
-exports.bestSaxParser = null;
-['./sax/sax_expat.js', './sax/sax_ltx.js', /*'./sax/sax_easysax.js', './sax/sax_node-xml.js',*/ './sax/sax_saxjs.js'].forEach(function(modName) {
-    var mod;
+exports.availableSaxParsers = []
+exports.bestSaxParser = null
+
+var saxParsers = [
+    './sax/sax_expat.js',
+    './sax/sax_ltx.js',
+    /*'./sax_easysax.js', './sax_node-xml.js',*/
+    './sax/sax_saxjs.js'
+]
+
+saxParsers.forEach(function(modName) {
+    var mod
     try {
-    mod = require(modName);
+    mod = require(modName)
     } catch (e) {
-    /* Silently missing libraries drop; for debug:
-    console.error(e.stack || e);
+    /* Silently missing libraries drop for debug:
+    console.error(e.stack || e)
      */
     }
     if (mod) {
-    exports.availableSaxParsers.push(mod);
+    exports.availableSaxParsers.push(mod)
     if (!exports.bestSaxParser)
-        exports.bestSaxParser = mod;
+        exports.bestSaxParser = mod
     }
-});
-var element = require('./element');
+})
+
+var element = require('./element')
 
 exports.Parser = function(saxParser) {
-    events.EventEmitter.call(this);
-    var that = this;
+    events.EventEmitter.call(this)
+    var that = this
 
-    var parserMod = saxParser || exports.bestSaxParser;
+    var parserMod = saxParser || exports.bestSaxParser
     if (!parserMod)
-    throw new Error("No SAX parser available");
-    this.parser = new parserMod();
+    throw new Error('No SAX parser available')
+    this.parser = new parserMod()
 
-    var el;
+    var el
     this.parser.addListener('startElement', function(name, attrs) {
-        var child = new element.Element(name, attrs);
+        var child = new element.Element(name, attrs)
         if (!el) {
-            el = child;
+            el = child
         } else {
-            el = el.cnode(child);
+            el = el.cnode(child)
         }
-    });
+    })
     this.parser.addListener('endElement', function(name) {
         if (!el) {
             /* Err */
         } else if (el && name == el.name) {
             if (el.parent)
-                el = el.parent;
+                el = el.parent
             else if (!that.tree) {
-                that.tree = el;
-                el = undefined;
+                that.tree = el
+                el = undefined
             }
         }
-    });
+    })
     this.parser.addListener('text', function(str) {
         if (el)
-            el.t(str);
-    });
+            el.t(str)
+    })
     this.parser.addListener('error', function(e) {
-    that.error = e;
-    that.emit('error', e);
-    });
-};
-util.inherits(exports.Parser, events.EventEmitter);
+    that.error = e
+    that.emit('error', e)
+    })
+}
+util.inherits(exports.Parser, events.EventEmitter)
 
 exports.Parser.prototype.write = function(data) {
-    this.parser.write(data);
-};
+    this.parser.write(data)
+}
 
 exports.Parser.prototype.end = function(data) {
-    this.parser.end(data);
+    this.parser.end(data)
 
     if (!this.error) {
     if (this.tree)
-        this.emit('tree', this.tree);
+        this.emit('tree', this.tree)
     else
-        this.emit('error', new Error('Incomplete document'));
+        this.emit('error', new Error('Incomplete document'))
     }
-};
+}
 
 exports.parse = function(data, saxParser) {
-    var p = new exports.Parser(saxParser);
-    var result = null, error = null;
+    var p = new exports.Parser(saxParser)
+    var result = null, error = null
 
     p.on('tree', function(tree) {
-        result = tree;
-    });
+        result = tree
+    })
     p.on('error', function(e) {
-        error = e;
-    });
+        error = e
+    })
 
-    p.write(data);
-    p.end();
+    p.write(data)
+    p.end()
 
     if (error)
-        throw error;
+        throw error
     else
-        return result;
-};
+        return result
+}
diff --git a/lib/sax/sax_easysax.js b/lib/sax/sax_easysax.js
index 9ccdd4e..ed603ae 100644
--- a/lib/sax/sax_easysax.js
+++ b/lib/sax/sax_easysax.js
@@ -18,45 +18,45 @@ function SaxEasysax() {
     var that = this
 
     this.parser.on('startNode', function(name, attr, uq, istagend) {
-	attr = attr()
+    attr = attr()
 
-	if (attr === false) {
-		that.emit('error', 'attr char');
-		return false;
-	};
+    if (attr === false) {
+        that.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);
-    });
+        that.emit('startElement', name, attr)
+    })
     this.parser.on('endNode', function(name, uq, str, tagstart) {
-        that.emit('endElement', name);
-    });
+        that.emit('endElement', name)
+    })
     this.parser.on('textNode', function(str, uq) {
-        that.emit('text', uq(str));
-    });
+        that.emit('text', uq(str))
+    })
     this.parser.on('cdata', function(str) {
-        that.emit('text', str);
-    });
+        that.emit('text', str)
+    })
     this.parser.on('error', function(e) {
-	that.emit('error', e);
-    });
+    that.emit('error', e)
+    })
     // TODO: other events, esp. entityDecl (billion laughs!)
 
-    var sbuffer = '';
+    var sbuffer = ''
 
     this.write = function(data) {
-    	sbuffer += typeof data !== 'string' ? data.toString() : data;
-    };
+        sbuffer += typeof data !== 'string' ? data.toString() : data
+    }
 
     this.end = function(data) {
-    	sbuffer += typeof data !== 'string' ? data.toString() : data;
-    	this.parser(sbuffer);
-    	sbuffer = '';
-    };
-};
+        sbuffer += typeof data !== 'string' ? data.toString() : data
+        this.parser(sbuffer)
+        sbuffer = ''
+    }
+}
 
 
 
diff --git a/lib/sax/sax_expat.js b/lib/sax/sax_expat.js
index bea432e..3582572 100644
--- a/lib/sax/sax_expat.js
+++ b/lib/sax/sax_expat.js
@@ -8,7 +8,7 @@ var SaxExpat = module.exports = function SaxExpat() {
     events.EventEmitter.call(this)
     this.parser = new expat.Parser('UTF-8')
 
-    var that = this;
+    var that = this
     this.parser.on('startElement', function(name, attrs) {
         that.emit('startElement', name, attrs)
     })
@@ -32,7 +32,7 @@ SaxExpat.prototype.write = function(data) {
         this.write = function() { }
         this.end = function() { }
     }
-};
+}
 
 SaxExpat.prototype.end = function(data) {
     if (!this.parser.parse('', true)) {
diff --git a/lib/sax/sax_ltx.js b/lib/sax/sax_ltx.js
index e9019b2..5824c2d 100644
--- a/lib/sax/sax_ltx.js
+++ b/lib/sax/sax_ltx.js
@@ -1,4 +1,4 @@
-'use strict'
+'use strict';
 
 var util = require('util')
   , events = require('events')
diff --git a/lib/sax/sax_node-xml.js b/lib/sax/sax_node-xml.js
index 18d03a0..8a03d13 100644
--- a/lib/sax/sax_node-xml.js
+++ b/lib/sax/sax_node-xml.js
@@ -6,54 +6,54 @@ var util = require('util')
 
 /**
  * This cannot be used as long as node-xml starts parsing only after
- * setTimeout(f, 0);
+ * setTimeout(f, 0)
  */
 var SaxNodeXML = module.exports = function SaxNodeXML() {
-    events.EventEmitter.call(this);
-    var that = this;
+    events.EventEmitter.call(this)
+    var that = this
     this.parser = new xml.SaxParser(function(handler) {
-	handler.onStartElementNS(function(elem, attrs, prefix, uri, namespaces) {
-	    var i, attrsHash = {};
-	    if (prefix)
-		elem = prefix + ":" + elem;
-	    for(i = 0; i < attrs.length; i++) {
-		var attr = attrs[i];
-		attrsHash[attr[0]] = unescapeXml(attr[1]);
-	    }
-	    for(i = 0; i < namespaces.length; i++) {
-		var namespace = namespaces[i];
-		var k = !namespace[0] ? "xmlns" : "xmlns:" + namespace[0];
-		attrsHash[k] = unescapeXml(namespace[1]);
-	    }
-	    that.emit('startElement', elem, attrsHash);
-	});
-	handler.onEndElementNS(function(elem, prefix, uri) {
-	    if (prefix)
-		elem = prefix + ":" + elem;
-	    that.emit('endElement', elem);
-	});
-	handler.onCharacters(function(str) {
-	    that.emit('text', str);
-	});
-	handler.onCdata(function(str) {
-	    that.emit('text', str);
-	});
-	handler.onError(function(e) {
-	    that.emit('error', e);
-	});
-	// TODO: other events, esp. entityDecl (billion laughs!)
-    });
-};
-util.inherits(SaxNodeXML, events.EventEmitter);
+    handler.onStartElementNS(function(elem, attrs, prefix, uri, namespaces) {
+        var i, attrsHash = {}
+        if (prefix)
+        elem = prefix + ":" + elem
+        for(i = 0; i < attrs.length; i++) {
+        var attr = attrs[i]
+        attrsHash[attr[0]] = unescapeXml(attr[1])
+        }
+        for(i = 0; i < namespaces.length; i++) {
+        var namespace = namespaces[i]
+        var k = !namespace[0] ? "xmlns" : "xmlns:" + namespace[0]
+        attrsHash[k] = unescapeXml(namespace[1])
+        }
+        that.emit('startElement', elem, attrsHash)
+    })
+    handler.onEndElementNS(function(elem, prefix, uri) {
+        if (prefix)
+        elem = prefix + ":" + elem
+        that.emit('endElement', elem)
+    })
+    handler.onCharacters(function(str) {
+        that.emit('text', str)
+    })
+    handler.onCdata(function(str) {
+        that.emit('text', str)
+    })
+    handler.onError(function(e) {
+        that.emit('error', e)
+    })
+    // TODO: other events, esp. entityDecl (billion laughs!)
+    })
+}
+util.inherits(SaxNodeXML, events.EventEmitter)
 
 SaxNodeXML.prototype.write = function(data) {
-    this.parser.parseString(data);
-};
+    this.parser.parseString(data)
+}
 
 SaxNodeXML.prototype.end = function(data) {
     if (data)
-	this.write(data);
-};
+    this.write(data)
+}
 
 function unescapeXml(s) {
     return s.
@@ -61,5 +61,5 @@ function unescapeXml(s) {
         replace(/\</g, '<').
         replace(/\>/g, '>').
         replace(/\"/g, '"').
-        replace(/\'/g, '\'');
+        replace(/\'/g, '\'')
 }
diff --git a/lib/sax/sax_saxjs.js b/lib/sax/sax_saxjs.js
index 7a268eb..05dda18 100644
--- a/lib/sax/sax_saxjs.js
+++ b/lib/sax/sax_saxjs.js
@@ -32,7 +32,7 @@ util.inherits(SaxSaxjs, events.EventEmitter)
 
 SaxSaxjs.prototype.write = function(data) {
     if (typeof data !== 'string') {
-	    data = data.toString()
+        data = data.toString()
     }
     this.parser.write(data)
 }
diff --git a/test/parse-test.js b/test/parse-test.js
index 1118d32..749761d 100644
--- a/test/parse-test.js
+++ b/test/parse-test.js
@@ -24,8 +24,8 @@ ltx.availableSaxParsers.forEach(function(saxParser) {
                 assert.equal("<>&\"'", el.getText());
             },
             'attribute with entities': function() {
-		var el = parse("<body title='<>&"''/>");
-		assert.equal("<>&\"'", el.attrs.title);
+        var el = parse("<body title='<>&"''/>");
+        assert.equal("<>&\"'", el.attrs.title);
             },
             'erroneous document raises error': function() {
                 assert.throws(function() {
@@ -49,41 +49,41 @@ ltx.availableSaxParsers.forEach(function(saxParser) {
                 assert.equal(el.getName(), 'root');
                 assert.ok(el.is('root', 'https://github.com/astro/ltx'));
             },
-	    'buffer': function() {
-		var buf = new Buffer('<root/>');
-		var el = parse(buf);
+        'buffer': function() {
+        var buf = new Buffer('<root/>');
+        var el = parse(buf);
                 assert.equal(el.name, 'root');
                 assert.equal(0, el.children.length);
-	    },
-	    'utf-8 text': function() {
-		var el = parse('<?xml version="1.0" encoding="utf-8"?><text>Möwe</text>');
+        },
+        'utf-8 text': function() {
+        var el = parse('<?xml version="1.0" encoding="utf-8"?><text>Möwe</text>');
                 assert.equal(el.name, 'text');
                 assert.equal(el.getText(), "Möwe");
-	    },
-	    'iso8859-1 text': function() {
-		var el = parse('<?xml version="1.0" encoding="iso-8859-1"?><text>M\xF6we</text>');
+        },
+        'iso8859-1 text': function() {
+        var el = parse('<?xml version="1.0" encoding="iso-8859-1"?><text>M\xF6we</text>');
                 assert.equal(el.name, 'text');
                 assert.equal(el.getText(), "Möwe");
-	    }
+        }
         },
-	'SAX parsing': {
-	    'XMPP stream': function() {
-		var parser = new saxParser();
-		var events = [];
-		parser.on('startElement', function(name, attrs) {
-		    events.push({ start: name, attrs: attrs });
-		});
-		parser.on('endElement', function(name) {
-		    events.push({ end: name });
-		});
-		parser.on('text', function(s) {
-		    events.push({ text: s });
-		});
-		parser.write("<?xml version='1.0'?><stream:stream xmlns='jabber:client'");
-		parser.write(" xmlns:stream='http://etherx.jabber.org/streams' id='5568");
-		assert.equal(events.length, 0);
-		parser.write("90365' from='jabber.ccc.de' version='1.0' xml:lang='en'><");
-		assert.equal(events.length, 1);
+    'SAX parsing': {
+        'XMPP stream': function() {
+        var parser = new saxParser();
+        var events = [];
+        parser.on('startElement', function(name, attrs) {
+            events.push({ start: name, attrs: attrs });
+        });
+        parser.on('endElement', function(name) {
+            events.push({ end: name });
+        });
+        parser.on('text', function(s) {
+            events.push({ text: s });
+        });
+        parser.write("<?xml version='1.0'?><stream:stream xmlns='jabber:client'");
+        parser.write(" xmlns:stream='http://etherx.jabber.org/streams' id='5568");
+        assert.equal(events.length, 0);
+        parser.write("90365' from='jabber.ccc.de' version='1.0' xml:lang='en'><");
+        assert.equal(events.length, 1);
         testStanza(events[0], {name:'stream:stream', attrs:{
             xmlns:"jabber:client",
             'xmlns:stream':"http://etherx.jabber.org/streams",
@@ -92,23 +92,23 @@ ltx.availableSaxParsers.forEach(function(saxParser) {
             version:"1.0",
             'xml:lang':"en"
         }});
-		parser.write("stream:features><starttls xmlns='urn:ietf:params:xml:ns:x");
-		assert.equal(events.length, 2);
+        parser.write("stream:features><starttls xmlns='urn:ietf:params:xml:ns:x");
+        assert.equal(events.length, 2);
         testStanza(events[1], {name:'stream:features', attrs:{}});
-		parser.write("mpp-tls'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-");
-		assert.equal(events.length, 4);
+        parser.write("mpp-tls'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-");
+        assert.equal(events.length, 4);
         testStanza(events[2], {name:'starttls', attrs:{
             xmlns:"urn:ietf:params:xml:ns:xmpp-tls"
         }});
         assert.equal(events[3].end, 'starttls');
-		parser.write("sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</");
-		assert.ok(events.length >= 9);
-		parser.write("mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms>");
-		assert.equal(events.length, 15);
-		parser.write("<register xmlns='http://jabber.org/features/iq-register'/");
-		assert.equal(events.length, 15);
-		parser.write("></stream:features>");
-		assert.equal(events.length, 18);
+        parser.write("sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</");
+        assert.ok(events.length >= 9);
+        parser.write("mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms>");
+        assert.equal(events.length, 15);
+        parser.write("<register xmlns='http://jabber.org/features/iq-register'/");
+        assert.equal(events.length, 15);
+        parser.write("></stream:features>");
+        assert.equal(events.length, 18);
         },
         'bug: partial attrs': function() {
             var parser = new saxParser();
@@ -138,8 +138,8 @@ ltx.availableSaxParsers.forEach(function(saxParser) {
             testStanza(events[1], {name:'mechanisms', attrs:{
                 xmlns:"urn:ietf:params:xml:ns:xmpp-sasl"
             }});
-	    }
-	}
+        }
+    }
     }).export(module);
 });
 

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