Comparing version 0.4.1 to 0.4.2
@@ -15,2 +15,7 @@ 'use strict'; | ||
DOMElement.prototype._getElement = function(name, attrs) { | ||
var element = new DOMElement(name, attrs) | ||
return element | ||
} | ||
Object.defineProperty(DOMElement.prototype, 'localName', { | ||
@@ -17,0 +22,0 @@ get: function () { |
@@ -199,5 +199,10 @@ 'use strict'; | ||
Element.prototype._getElement = function(name, attrs) { | ||
var element = new Element(name, attrs) | ||
return element | ||
} | ||
/** create child node and return it */ | ||
Element.prototype.c = function(name, attrs) { | ||
return this.cnode(new Element(name, attrs)) | ||
return this.cnode(this._getElement(name, attrs)) | ||
} | ||
@@ -250,3 +255,3 @@ | ||
Element.prototype.clone = function() { | ||
var clone = new Element(this.name, {}) | ||
var clone = this._getElement(this.name, {}) | ||
for (var k in this.attrs) { | ||
@@ -352,2 +357,2 @@ if (this.attrs.hasOwnProperty(k)) | ||
exports.Element = Element | ||
exports.escapeXml = escapeXml | ||
exports.escapeXml = escapeXml |
@@ -16,2 +16,7 @@ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
DOMElement.prototype._getElement = function(name, attrs) { | ||
var element = new DOMElement(name, attrs) | ||
return element | ||
} | ||
Object.defineProperty(DOMElement.prototype, 'localName', { | ||
@@ -295,5 +300,10 @@ get: function () { | ||
Element.prototype._getElement = function(name, attrs) { | ||
var element = new Element(name, attrs) | ||
return element | ||
} | ||
/** create child node and return it */ | ||
Element.prototype.c = function(name, attrs) { | ||
return this.cnode(new Element(name, attrs)) | ||
return this.cnode(this._getElement(name, attrs)) | ||
} | ||
@@ -346,3 +356,3 @@ | ||
Element.prototype.clone = function() { | ||
var clone = new Element(this.name, {}) | ||
var clone = this._getElement(this.name, {}) | ||
for (var k in this.attrs) { | ||
@@ -449,2 +459,3 @@ if (this.attrs.hasOwnProperty(k)) | ||
exports.escapeXml = escapeXml | ||
},{}],3:[function(require,module,exports){ | ||
@@ -1755,3 +1766,3 @@ 'use strict'; | ||
}).call(this,require("/home/lloyd/Dropbox/code/node-xmpp/ltx/node_modules/grunt-browserify/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) | ||
},{"./support/isBuffer":10,"/home/lloyd/Dropbox/code/node-xmpp/ltx/node_modules/grunt-browserify/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":9,"inherits":8}]},{},[3]) | ||
}).call(this,require("/Users/lloyd/Dropbox/code/xmpp-ftw/ltx/node_modules/grunt-browserify/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) | ||
},{"./support/isBuffer":10,"/Users/lloyd/Dropbox/code/xmpp-ftw/ltx/node_modules/grunt-browserify/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":9,"inherits":8}]},{},[3]) |
{ | ||
"name": "ltx", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"main": "./lib/index", | ||
@@ -5,0 +5,0 @@ "browser": "./lib/index-browserify", |
@@ -187,3 +187,10 @@ 'use strict'; | ||
} | ||
}, | ||
'issue-37: Element instanceof Fails': { | ||
'instanceof': function() { | ||
var el = new ltx.Element('root').c('children') | ||
assert.ok(el instanceof ltx.Element) | ||
} | ||
} | ||
}).export(module) | ||
}).export(module) |
100462
2950