Lint Mithril main

This changes enough things to merit a new patch release. It changed a few
implementation details in the process, but it's at least much cleaner.

Be ready for every other currently outstanding PR for this file to have merge
conflicts.
This commit is contained in:
impinball 2015-11-03 00:53:15 -05:00
parent 4902ee7d6f
commit 96bcc81022
8 changed files with 1780 additions and 1043 deletions

View file

@ -54,6 +54,8 @@ describe("m.mount()", function () {
})
it("reloads components correctly", function () {
if (mock.phantom) return
mock.requestAnimationFrame.$resolve()
var root1 = mock.document.createElement("div")
@ -545,6 +547,8 @@ describe("m.mount()", function () {
// https://github.com/lhorie/mithril.js/issues/551
it("only redraws a component when clicked", function () {
if (mock.phantom) return
var root = mock.document.createElement("div")
var a = false
var found = {}
@ -627,6 +631,8 @@ describe("m.mount()", function () {
})
it("redraws when clicked and click handler forces redraw", function () {
if (mock.phantom) return
var root = mock.document.createElement("div")
var view = sinon.stub().returns(m("div", {
onclick: function () { m.redraw(true) }

View file

@ -31,6 +31,8 @@ describe("m.redraw()", function () {
})
it("runs unnecessary redraws asynchronously", function () {
if (mock.phantom) return
var root = mock.document.createElement("div")
var view = sinon.spy()
@ -196,6 +198,8 @@ describe("m.redraw()", function () {
})
dit("recreates the component when \"all\"", function (root) {
if (mock.phantom) return
var count = 0
function config(el, init) {
if (!init) count++