Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Cleaned up tabs and spacing for stylistic reasons.

Signed-off-by: Nick Campbell <nicholas.j.campbell@gmail.com>
  • Loading branch information...
commit 4e72d02af901b145d6ff034464eb4f31b6737964 1 parent bca1348
@ncb000gt ncb000gt authored
Showing with 36 additions and 36 deletions.
  1. +15 −15 lib/document.js
  2. +21 −21 test/document.js
View
30 lib/document.js
@@ -74,21 +74,21 @@ Document.prototype.validate = function(xsd) {
};
Document.prototype.setDtd = function(name, ext, sys) {
- if (!name) {
- throw new Error('Must pass in a DTD name');
- } else if (typeof name !== 'string') {
- throw new Error('Must pass in a valid DTD name');
- }
-
- var params = [name];
- if (typeof ext !== 'undefined') {
- params.push(ext);
- }
- if (ext && typeof sys !== 'undefined') {
- params.push(sys);
- }
-
- return this._setDtd.apply(this, params);
+ if (!name) {
+ throw new Error('Must pass in a DTD name');
+ } else if (typeof name !== 'string') {
+ throw new Error('Must pass in a valid DTD name');
+ }
+
+ var params = [name];
+ if (typeof ext !== 'undefined') {
+ params.push(ext);
+ }
+ if (ext && typeof sys !== 'undefined') {
+ params.push(sys);
+ }
+
+ return this._setDtd.apply(this, params);
};
/// @return array of namespaces in document
View
42 test/document.js
@@ -1,27 +1,27 @@
var libxml = require('../index');
module.exports.setDtd = function(assert) {
- var doc = libxml.Document();
- doc.setDtd("html");
- assert.ok(doc);
- assert.equal('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE html>\n', doc.toString());
- doc.setDtd("html", "bacon", "bacon");
- assert.ok(doc);
- assert.equal('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE html PUBLIC "bacon" "bacon">\n', doc.toString());
- doc.setDtd("html", null);
- assert.ok(doc);
- assert.equal('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE html>\n', doc.toString());
- assert.throws(function() {
- doc.setDtd(5);
- });
- assert.ok(doc);
- assert.equal('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE html>\n', doc.toString());
- assert.throws(function() {
- doc.setDtd();
- });
- assert.ok(doc);
- assert.equal('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE html>\n', doc.toString());
- assert.done();
+ var doc = libxml.Document();
+ doc.setDtd("html");
+ assert.ok(doc);
+ assert.equal('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE html>\n', doc.toString());
+ doc.setDtd("html", "bacon", "bacon");
+ assert.ok(doc);
+ assert.equal('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE html PUBLIC "bacon" "bacon">\n', doc.toString());
+ doc.setDtd("html", null);
+ assert.ok(doc);
+ assert.equal('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE html>\n', doc.toString());
+ assert.throws(function() {
+ doc.setDtd(5);
+ });
+ assert.ok(doc);
+ assert.equal('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE html>\n', doc.toString());
+ assert.throws(function() {
+ doc.setDtd();
+ });
+ assert.ok(doc);
+ assert.equal('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE html>\n', doc.toString());
+ assert.done();
};
module.exports.blank = function(assert) {
Please sign in to comment.
Something went wrong with that request. Please try again.