From: Aleksander Ɓukasz Date: Mon, 7 Oct 2013 12:12:23 +0000 (+0200) Subject: fix X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/ba1e24e73cbeef44c1a08c8d225cc12923f3dfd6?hp=a4e2af35996896240356ad8ca4c7b6003d4b9ff3 fix --- 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);