From 633f1f53d3dc176c6b554563a9533d05e3eefebe Mon Sep 17 00:00:00 2001 From: DanielApt Date: Fri, 27 Mar 2015 16:58:10 +0000 Subject: [PATCH 1/3] Check if parentNode exists We need to check if parentNode exists, as in some scenarios it does not (e.g. phantomjs < 2) --- src/js/lib/dom.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/lib/dom.js b/src/js/lib/dom.js index 48e785f..8d6b4fa 100644 --- a/src/js/lib/dom.js +++ b/src/js/lib/dom.js @@ -70,6 +70,6 @@ exports.remove = function (element) { if (typeof element.remove !== 'undefined') { element.remove(); } else { - element.parentNode.removeChild(element); + element.parentNode && element.parentNode.removeChild(element); } }; From bb58ab98e3652dc2c5916f42c321a272fbf1c317 Mon Sep 17 00:00:00 2001 From: DanielApt Date: Fri, 27 Mar 2015 18:28:51 +0000 Subject: [PATCH 2/3] Fix failing test --- src/js/lib/dom.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/lib/dom.js b/src/js/lib/dom.js index 8d6b4fa..40f56fd 100644 --- a/src/js/lib/dom.js +++ b/src/js/lib/dom.js @@ -70,6 +70,8 @@ exports.remove = function (element) { if (typeof element.remove !== 'undefined') { element.remove(); } else { - element.parentNode && element.parentNode.removeChild(element); + if (element.parentNode) { + element.parentNode.removeChild(element); + } } }; From aca7683de19a657fb9920a84a93c8266d6a50a66 Mon Sep 17 00:00:00 2001 From: DanielApt Date: Thu, 2 Apr 2015 10:18:46 +0100 Subject: [PATCH 3/3] Change tab size to 2 --- src/js/lib/dom.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/js/lib/dom.js b/src/js/lib/dom.js index 40f56fd..49a3a4e 100644 --- a/src/js/lib/dom.js +++ b/src/js/lib/dom.js @@ -70,8 +70,8 @@ exports.remove = function (element) { if (typeof element.remove !== 'undefined') { element.remove(); } else { - if (element.parentNode) { - element.parentNode.removeChild(element); - } + if (element.parentNode) { + element.parentNode.removeChild(element); + } } };