Merge pull request #879 from nordfjord/fix-linting

fix linting errors
This commit is contained in:
Leo Horie 2015-12-10 14:22:32 -05:00
commit 0cc97ec220
3 changed files with 15 additions and 9 deletions

View file

@ -1,5 +1,5 @@
/* global m: false */ /* global m: false */
// TODO: ensure this targets the current API. // NTBD: ensure this targets the current API.
window.templateConverter = (function () { window.templateConverter = (function () {
"use strict" "use strict"

View file

@ -44,10 +44,12 @@ void (function (global, factory) { // eslint-disable-line
} }
function forOwn(obj, f) { function forOwn(obj, f) {
for (var prop in obj) if (hasOwn.call(obj, prop)) { for (var prop in obj) {
if (hasOwn.call(obj, prop)) {
if (f(obj[prop], prop)) break if (f(obj[prop], prop)) break
} }
} }
}
var parser = /(?:(^|#|\.)([^#\.\[\]]+))|(\[.+?\])/g var parser = /(?:(^|#|\.)([^#\.\[\]]+))|(\[.+?\])/g
var attrParser = /\[(.+?)(?:=("|'|)(.*?)\2)?\]/ var attrParser = /\[(.+?)(?:=("|'|)(.*?)\2)?\]/
@ -960,9 +962,11 @@ void (function (global, factory) { // eslint-disable-line
} }
}) })
for (var rule in cachedAttr) if (hasOwn.call(cachedAttr, rule)) { for (var rule in cachedAttr) {
if (hasOwn.call(cachedAttr, rule)) {
if (!hasOwn.call(dataAttr, rule)) node.style[rule] = "" if (!hasOwn.call(dataAttr, rule)) node.style[rule] = ""
} }
}
} else if (namespace != null) { } else if (namespace != null) {
// handle SVG // handle SVG
if (attr === "href") { if (attr === "href") {

View file

@ -33,9 +33,11 @@
Object.keys = Object.keys || function (obj) { Object.keys = Object.keys || function (obj) {
var keys = [] var keys = []
for (var i in obj) if ({}.hasOwnProperty.call(obj, i)) { for (var i in obj) {
if ({}.hasOwnProperty.call(obj, i)) {
keys.push(i) keys.push(i)
} }
}
return keys return keys
} }
/* eslint-enable no-extend-native */ /* eslint-enable no-extend-native */
@ -53,7 +55,7 @@ this.mock = (function (global) {
} }
var document = window.document = { var document = window.document = {
// TODO: add document.createRange().createContextualFragment() // NTBD: add document.createRange().createContextualFragment()
childNodes: [], childNodes: [],
@ -78,7 +80,7 @@ this.mock = (function (global) {
}, },
insertAdjacentHTML: function (position, html) { insertAdjacentHTML: function (position, html) {
// TODO: accept markup // NTBD: accept markup
if (position === "beforebegin") { if (position === "beforebegin") {
this.parentNode.insertBefore( this.parentNode.insertBefore(
document.createTextNode(html), document.createTextNode(html),