From 5ef5addb8261c43f72e1b0891e3ab2be470ca781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Einar=20Nor=C3=B0fj=C3=B6r=C3=B0?= Date: Thu, 10 Dec 2015 19:01:52 +0000 Subject: [PATCH] fix linting errors --- docs/layout/tools/template-converter.js | 2 +- mithril.js | 12 ++++++++---- test-deps/mock.js | 10 ++++++---- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/docs/layout/tools/template-converter.js b/docs/layout/tools/template-converter.js index 55217ba3..ccd4faff 100644 --- a/docs/layout/tools/template-converter.js +++ b/docs/layout/tools/template-converter.js @@ -1,5 +1,5 @@ /* global m: false */ -// TODO: ensure this targets the current API. +// NTBD: ensure this targets the current API. window.templateConverter = (function () { "use strict" diff --git a/mithril.js b/mithril.js index cec9a331..d710445b 100644 --- a/mithril.js +++ b/mithril.js @@ -44,8 +44,10 @@ void (function (global, factory) { // eslint-disable-line } function forOwn(obj, f) { - for (var prop in obj) if (hasOwn.call(obj, prop)) { - if (f(obj[prop], prop)) break + for (var prop in obj) { + if (hasOwn.call(obj, prop)) { + if (f(obj[prop], prop)) break + } } } @@ -960,8 +962,10 @@ void (function (global, factory) { // eslint-disable-line } }) - for (var rule in cachedAttr) if (hasOwn.call(cachedAttr, rule)) { - if (!hasOwn.call(dataAttr, rule)) node.style[rule] = "" + for (var rule in cachedAttr) { + if (hasOwn.call(cachedAttr, rule)) { + if (!hasOwn.call(dataAttr, rule)) node.style[rule] = "" + } } } else if (namespace != null) { // handle SVG diff --git a/test-deps/mock.js b/test-deps/mock.js index 239af53c..698f86bc 100644 --- a/test-deps/mock.js +++ b/test-deps/mock.js @@ -33,8 +33,10 @@ Object.keys = Object.keys || function (obj) { var keys = [] - for (var i in obj) if ({}.hasOwnProperty.call(obj, i)) { - keys.push(i) + for (var i in obj) { + if ({}.hasOwnProperty.call(obj, i)) { + keys.push(i) + } } return keys } @@ -53,7 +55,7 @@ this.mock = (function (global) { } var document = window.document = { - // TODO: add document.createRange().createContextualFragment() + // NTBD: add document.createRange().createContextualFragment() childNodes: [], @@ -78,7 +80,7 @@ this.mock = (function (global) { }, insertAdjacentHTML: function (position, html) { - // TODO: accept markup + // NTBD: accept markup if (position === "beforebegin") { this.parentNode.insertBefore( document.createTextNode(html),