[Pkg-javascript-commits] [ltx] 179/469: findNS(): check for this.parent before recursing up

Jonas Smedegaard dr at jones.dk
Wed Aug 31 13:01:42 UTC 2016


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository ltx.

commit 4d14e13df95162a6b8f8e6e6f3a51aac2467aaa9
Author: Astro <astro at spaceboyz.net>
Date:   Mon Sep 19 15:45:39 2011 +0200

    findNS(): check for this.parent before recursing up
---
 lib/element.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/element.js b/lib/element.js
index 6b63af4..cd9e8f3 100644
--- a/lib/element.js
+++ b/lib/element.js
@@ -49,14 +49,14 @@ Element.prototype.findNS = function(prefix) {
         /* default namespace */
         if (this.attrs.xmlns)
             return this.attrs.xmlns;
-        else
+        else if (this.parent)
             return this.parent.findNS();
     } else {
         /* prefixed namespace */
         var attr = 'xmlns:' + prefix;
         if (this.attrs[attr])
             return this.attrs[attr];
-        else
+        else if (this.parent)
             return this.parent.findNS(prefix);
     }
 };

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/ltx.git



More information about the Pkg-javascript-commits mailing list