From 6a5fbef4db2934efd05c251124bd2b62180fe549 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Thu, 24 Oct 2013 15:02:16 +0200 Subject: [PATCH] smartxml: fixing inheritance to support for instanceof operator to work properly --- src/smartxml/smartxml.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/smartxml/smartxml.js b/src/smartxml/smartxml.js index 47e2b2e..a396d3e 100644 --- a/src/smartxml/smartxml.js +++ b/src/smartxml/smartxml.js @@ -67,8 +67,9 @@ $.extend(DocumentNode.prototype, { var ElementNode = function(nativeNode, document) { DocumentNode.call(this, nativeNode, document); }; +ElementNode.prototype = Object.create(DocumentNode.prototype); -$.extend(ElementNode.prototype, DocumentNode.prototype, { +$.extend(ElementNode.prototype, { nodeType: Node.ELEMENT_NODE, setData: function(key, value) { @@ -212,8 +213,9 @@ $.extend(ElementNode.prototype, DocumentNode.prototype, { var TextNode = function(nativeNode, document) { DocumentNode.call(this, nativeNode, document); }; +TextNode.prototype = Object.create(DocumentNode.prototype); -$.extend(TextNode.prototype, DocumentNode.prototype, { +$.extend(TextNode.prototype, { nodeType: Node.TEXT_NODE, getText: function() { -- 2.20.1