Fix lint errors
This commit is contained in:
parent
9999fbe2a4
commit
0f9274f873
7 changed files with 47 additions and 47 deletions
|
|
@ -534,7 +534,7 @@ o.spec("attributes", function() {
|
|||
attribute. Ask isiahmeadows.
|
||||
|
||||
o("render select options", function() {
|
||||
var select = m("select", {selectedIndex: 0},
|
||||
var select = m("select", {selectedIndex: 0},
|
||||
m("option", {value: "1", selected: ""})
|
||||
)
|
||||
render(root, select)
|
||||
|
|
|
|||
|
|
@ -174,8 +174,8 @@ o.spec("form inputs", function() {
|
|||
|
||||
o.spec("select", function() {
|
||||
o("select works without attributes", function() {
|
||||
var select = m("select",
|
||||
m("option", {value: "a"}, "aaa"),
|
||||
var select = m("select",
|
||||
m("option", {value: "a"}, "aaa")
|
||||
)
|
||||
|
||||
render(root, select)
|
||||
|
|
@ -248,7 +248,7 @@ o.spec("form inputs", function() {
|
|||
var select = m("select", {value: "b"},
|
||||
m("option", {value: "a"}, "aaa"),
|
||||
m("option", {value: "b"}, "bbb"),
|
||||
m("option", {value: "c"}, "ccc"),
|
||||
m("option", {value: "c"}, "ccc")
|
||||
)
|
||||
|
||||
render(root, select)
|
||||
|
|
@ -262,7 +262,7 @@ o.spec("form inputs", function() {
|
|||
return m("select", {value: "b"},
|
||||
m("option", {value: "a"}, "aaa"),
|
||||
m("option", {value: "b"}, "bbb"),
|
||||
m("option", {value: "c"}, "ccc"),
|
||||
m("option", {value: "c"}, "ccc")
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -302,38 +302,38 @@ o.spec("onbeforeupdate", function() {
|
|||
o(root.firstChild.attributes["id"].value).equals("bar")
|
||||
})
|
||||
o("old children is retained", function() {
|
||||
render(root,
|
||||
render(root,
|
||||
m("div", {onbeforeupdate: function() { return true }},
|
||||
m("div")
|
||||
),
|
||||
)
|
||||
)
|
||||
render(root,
|
||||
render(root,
|
||||
m("div", {onbeforeupdate: function() { return false }},
|
||||
m("div", m("div"))
|
||||
),
|
||||
)
|
||||
)
|
||||
render(root,
|
||||
render(root,
|
||||
m("div", {onbeforeupdate: function() { return true }},
|
||||
m("div", m("div"))
|
||||
),
|
||||
)
|
||||
)
|
||||
o(root.firstChild.firstChild.childNodes.length).equals(1)
|
||||
})
|
||||
o("old text is retained", function() {
|
||||
render(root,
|
||||
render(root,
|
||||
m("div", {onbeforeupdate: function() { return true }},
|
||||
m("div")
|
||||
),
|
||||
)
|
||||
)
|
||||
render(root,
|
||||
render(root,
|
||||
m("div", {onbeforeupdate: function() { return false }},
|
||||
m("div", "foo")
|
||||
),
|
||||
)
|
||||
)
|
||||
render(root,
|
||||
render(root,
|
||||
m("div", {onbeforeupdate: function() { return true }},
|
||||
m("div", "foo")
|
||||
),
|
||||
)
|
||||
)
|
||||
o(root.firstChild.firstChild.firstChild.nodeValue).equals("foo")
|
||||
})
|
||||
|
|
@ -346,38 +346,38 @@ o.spec("onbeforeupdate", function() {
|
|||
}
|
||||
}
|
||||
|
||||
render(root,
|
||||
render(root,
|
||||
m("div", {onbeforeupdate: function() { return true }},
|
||||
m(Child, {foo: false})
|
||||
),
|
||||
)
|
||||
)
|
||||
render(root,
|
||||
render(root,
|
||||
m("div", {onbeforeupdate: function() { return false }},
|
||||
m(Child, {foo: false})
|
||||
),
|
||||
)
|
||||
)
|
||||
render(root,
|
||||
render(root,
|
||||
m("div", {onbeforeupdate: function() { return true }},
|
||||
m(Child, {foo: true})
|
||||
),
|
||||
)
|
||||
)
|
||||
o(root.firstChild.firstChild.childNodes.length).equals(1)
|
||||
})
|
||||
o("adding dom children doesn't error", function() {
|
||||
render(root,
|
||||
render(root,
|
||||
m("div", {onbeforeupdate: function() { return true }},
|
||||
m("div")
|
||||
),
|
||||
)
|
||||
)
|
||||
render(root,
|
||||
render(root,
|
||||
m("div", {onbeforeupdate: function() { return false }},
|
||||
m("div")
|
||||
),
|
||||
)
|
||||
)
|
||||
render(root,
|
||||
render(root,
|
||||
m("div", {onbeforeupdate: function() { return true }},
|
||||
m("div", m("div"))
|
||||
),
|
||||
)
|
||||
)
|
||||
o(root.firstChild.firstChild.childNodes.length).equals(1)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ o.spec("oninit", function() {
|
|||
o(vnode.dom.oninit).equals(undefined)
|
||||
o(vnode.dom.attributes["oninit"]).equals(undefined)
|
||||
})
|
||||
|
||||
|
||||
o("No spurious oninit calls in mapped keyed diff when the pool is involved (#1992)", function () {
|
||||
var oninit1 = o.spy()
|
||||
var oninit2 = o.spy()
|
||||
|
|
|
|||
|
|
@ -238,9 +238,9 @@ o.spec("onremove", function() {
|
|||
return {then: function (r) { resolve = r }}
|
||||
},
|
||||
},
|
||||
m("div", id),
|
||||
m("div", id)
|
||||
)
|
||||
),
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
@ -344,9 +344,9 @@ o.spec("onremove", function() {
|
|||
}}
|
||||
},
|
||||
},
|
||||
m("div", id),
|
||||
m("div", id)
|
||||
)
|
||||
),
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -218,13 +218,13 @@ o.spec("render", function() {
|
|||
var a = function() {
|
||||
return m("div", {key: 1},
|
||||
m("div", {key: 11, oncreate: createA, onupdate: updateA, onremove: removeA}),
|
||||
m("div", {key: 12}),
|
||||
m("div", {key: 12})
|
||||
)
|
||||
}
|
||||
var b = function() {
|
||||
return m("div", {key: 2},
|
||||
m("div", {key: 21, oncreate: createB, onupdate: updateB, onremove: removeB}),
|
||||
m("div", {key: 22}),
|
||||
m("div", {key: 22})
|
||||
)
|
||||
}
|
||||
render(root, a())
|
||||
|
|
@ -247,12 +247,12 @@ o.spec("render", function() {
|
|||
var removeB = o.spy()
|
||||
var a = function() {
|
||||
return m("div", {key: 1},
|
||||
m("div", {oncreate: createA, onupdate: updateA, onremove: removeA}),
|
||||
m("div", {oncreate: createA, onupdate: updateA, onremove: removeA})
|
||||
)
|
||||
}
|
||||
var b = function() {
|
||||
return m("div", {key: 2},
|
||||
m("div", {oncreate: createB, onupdate: updateB, onremove: removeB}),
|
||||
m("div", {oncreate: createB, onupdate: updateB, onremove: removeB})
|
||||
)
|
||||
}
|
||||
render(root, a())
|
||||
|
|
@ -276,12 +276,12 @@ o.spec("render", function() {
|
|||
|
||||
var a = function() {
|
||||
return m("div", {key: 1},
|
||||
m("div", {oncreate: createA, onupdate: updateA, onremove: removeA}),
|
||||
m("div", {oncreate: createA, onupdate: updateA, onremove: removeA})
|
||||
)
|
||||
}
|
||||
var b = function() {
|
||||
return m("div", {key: 2},
|
||||
m("div", {oncreate: createB, onupdate: updateB, onremove: removeB}),
|
||||
m("div", {oncreate: createB, onupdate: updateB, onremove: removeB})
|
||||
)
|
||||
}
|
||||
render(root, a())
|
||||
|
|
@ -304,9 +304,9 @@ o.spec("render", function() {
|
|||
})
|
||||
o("svg namespace is preserved in keyed diff (#1820)", function(){
|
||||
// note that this only exerciese one branch of the keyed diff algo
|
||||
var svg = m("svg",
|
||||
var svg = m("svg",
|
||||
m("g", {key: 0}),
|
||||
m("g", {key: 1}),
|
||||
m("g", {key: 1})
|
||||
)
|
||||
render(root, svg)
|
||||
|
||||
|
|
@ -314,9 +314,9 @@ o.spec("render", function() {
|
|||
o(svg.dom.childNodes[0].namespaceURI).equals("http://www.w3.org/2000/svg")
|
||||
o(svg.dom.childNodes[1].namespaceURI).equals("http://www.w3.org/2000/svg")
|
||||
|
||||
svg = m("svg",
|
||||
svg = m("svg",
|
||||
m("g", {key: 1, x: 1}),
|
||||
m("g", {key: 2, x: 2}),
|
||||
m("g", {key: 2, x: 2})
|
||||
)
|
||||
render(root, svg)
|
||||
|
||||
|
|
|
|||
|
|
@ -695,7 +695,7 @@ o.spec("updateNodes", function() {
|
|||
var vnodes = m("div",
|
||||
undefined,
|
||||
m("#", "a")
|
||||
)
|
||||
)
|
||||
var updated = m("div",
|
||||
m.fragment(m("#", "b")),
|
||||
undefined,
|
||||
|
|
@ -843,7 +843,7 @@ o.spec("updateNodes", function() {
|
|||
var onupdate = o.spy()
|
||||
var oncreate = o.spy()
|
||||
var cached = m("B", {key: 1},
|
||||
m("A", {oncreate: oncreate, onupdate: onupdate}, "A")
|
||||
m("A", {oncreate: oncreate, onupdate: onupdate}, "A")
|
||||
)
|
||||
render(root, m("div", cached))
|
||||
render(root, [])
|
||||
|
|
@ -857,7 +857,7 @@ o.spec("updateNodes", function() {
|
|||
var onupdate = o.spy()
|
||||
var oncreate = o.spy()
|
||||
var cached = m("B",
|
||||
m("A", {oncreate: oncreate, onupdate: onupdate}, "A")
|
||||
m("A", {oncreate: oncreate, onupdate: onupdate}, "A")
|
||||
)
|
||||
render(root, m("div", cached))
|
||||
render(root, [])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue