From ba1e24e73cbeef44c1a08c8d225cc12923f3dfd6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Mon, 7 Oct 2013 14:12:23 +0200 Subject: [PATCH] fix --- src/smartxml/smartxml.js | 3 +++ src/wlxml/wlxml.js | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/smartxml/smartxml.js b/src/smartxml/smartxml.js index 6b71026..1686abd 100644 --- a/src/smartxml/smartxml.js +++ b/src/smartxml/smartxml.js @@ -9,6 +9,9 @@ var TEXT_NODE = Node.TEXT_NODE; var DocumentNode = function(nativeNode, document) { + if(!document) { + throw new Error('undefined document for a node'); + } this.document = document; this.nativeNode = nativeNode; this._$ = $(nativeNode); diff --git a/src/wlxml/wlxml.js b/src/wlxml/wlxml.js index 10a79ed..1619e57 100644 --- a/src/wlxml/wlxml.js +++ b/src/wlxml/wlxml.js @@ -12,8 +12,8 @@ var isMetaAttribute = function(attrName) { // -var WLXMLElementNode = function(nativeNode) { - smartxml.ElementNode.call(this, nativeNode); +var WLXMLElementNode = function(nativeNode, document) { + smartxml.ElementNode.call(this, nativeNode, document); }; WLXMLElementNode.prototype = Object.create(smartxml.ElementNode.prototype); -- 2.20.1