From ae71219fad9905b3f522630121036ffd434ed8a7 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Sun, 9 Mar 2014 09:17:14 +0200 Subject: [PATCH] Partially revert "Enable `forin` and `freeze` rules." This reverts commit df5aa2c7221d09f531dc66f9d41c037f5365c88c. Conflicts: js/.jshintrc --- js/.jshintrc | 1 - js/push.js | 32 ++++++++++++-------------------- 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/js/.jshintrc b/js/.jshintrc index 2eac213..a9d8cde 100644 --- a/js/.jshintrc +++ b/js/.jshintrc @@ -4,7 +4,6 @@ "devel" : true, "eqeqeq" : true, "expr" : true, - "forin" : true, "freeze" : true, "latedef" : true, "nonbsp" : true, diff --git a/js/push.js b/js/push.js index c1a56d8..dae47fc 100644 --- a/js/push.js +++ b/js/push.js @@ -175,13 +175,11 @@ if (transitionFromObj.transition) { activeObj = extendWithDom(activeObj, '.content', activeDom.cloneNode(true)); for (key in bars) { - if (bars.hasOwnProperty(key)) { - barElement = document.querySelector(bars[key]); - if (activeObj[key]) { - swapContent(activeObj[key], barElement); - } else if (barElement) { - barElement.parentNode.removeChild(barElement); - } + barElement = document.querySelector(bars[key]); + if (activeObj[key]) { + swapContent(activeObj[key], barElement); + } else if (barElement) { + barElement.parentNode.removeChild(barElement); } } } @@ -208,9 +206,7 @@ options.container = options.container || options.transition ? document.querySelector('.content') : document.body; for (key in bars) { - if (bars.hasOwnProperty(key)) { - options[key] = options[key] || document.querySelector(bars[key]); - } + options[key] = options[key] || document.querySelector(bars[key]); } if (xhr && xhr.readyState < 4) { @@ -271,13 +267,11 @@ if (options.transition) { for (key in bars) { - if (bars.hasOwnProperty(key)) { - barElement = document.querySelector(bars[key]); - if (data[key]) { - swapContent(data[key], barElement); - } else if (barElement) { - barElement.parentNode.removeChild(barElement); - } + barElement = document.querySelector(bars[key]); + if (data[key]) { + swapContent(data[key], barElement); + } else if (barElement) { + barElement.parentNode.removeChild(barElement); } } } @@ -414,9 +408,7 @@ var result = {}; for (i in obj) { - if (obj.hasOwnProperty(i)) { - result[i] = obj[i]; - } + result[i] = obj[i]; } Object.keys(bars).forEach(function (key) {