Add editorconfig, resolve differences

This includes newlines, tabs, among other things.
This commit is contained in:
impinball 2016-06-18 02:59:42 -04:00
parent 80d0a69dab
commit b4fb21475c
90 changed files with 1707 additions and 1701 deletions

View file

@ -17,9 +17,9 @@ o.spec("onbeforeremove", function() {
var create = o.spy()
var update = o.spy()
var vnode = {tag: "div", attrs: {onbeforeremove: create}}
render(root, [vnode])
o(create.callCount).equals(0)
})
o("does not call onbeforeremove when updating", function() {
@ -27,29 +27,29 @@ o.spec("onbeforeremove", function() {
var update = o.spy()
var vnode = {tag: "div", attrs: {onbeforeremove: create}}
var updated = {tag: "div", attrs: {onbeforeremove: update}}
render(root, [vnode])
render(root, [updated])
o(create.callCount).equals(0)
o(update.callCount).equals(0)
})
o("calls onbeforeremove when removing element", function(done) {
var vnode = {tag: "div", attrs: {onbeforeremove: remove}}
render(root, [vnode])
render(root, [])
function remove(node, complete) {
o(node).equals(vnode)
o(root.childNodes.length).equals(1)
o(root.firstChild).equals(vnode.dom)
callAsync(function() {
o(root.childNodes.length).equals(1)
complete()
o(root.childNodes.length).equals(0)
done()
@ -58,20 +58,20 @@ o.spec("onbeforeremove", function() {
})
o("calls onbeforeremove when removing text", function(done) {
var vnode = {tag: "#", attrs: {onbeforeremove: remove}, children: "a"}
render(root, [vnode])
render(root, [])
function remove(node, complete) {
o(node).equals(vnode)
o(root.childNodes.length).equals(1)
o(root.firstChild).equals(vnode.dom)
callAsync(function() {
o(root.childNodes.length).equals(1)
complete()
o(root.childNodes.length).equals(0)
done()
@ -80,20 +80,20 @@ o.spec("onbeforeremove", function() {
})
o("calls onbeforeremove when removing fragment", function(done) {
var vnode = {tag: "[", attrs: {onbeforeremove: remove}, children: [{tag: "div"}]}
render(root, [vnode])
render(root, [])
function remove(node, complete) {
o(node).equals(vnode)
o(root.childNodes.length).equals(1)
o(root.firstChild).equals(vnode.dom)
callAsync(function() {
o(root.childNodes.length).equals(1)
complete()
o(root.childNodes.length).equals(0)
done()
@ -102,20 +102,20 @@ o.spec("onbeforeremove", function() {
})
o("calls onbeforeremove when removing html", function(done) {
var vnode = {tag: "<", attrs: {onbeforeremove: remove}, children: "a"}
render(root, [vnode])
render(root, [])
function remove(node, complete) {
o(node).equals(vnode)
o(root.childNodes.length).equals(1)
o(root.firstChild).equals(vnode.dom)
callAsync(function() {
o(root.childNodes.length).equals(1)
complete()
o(root.childNodes.length).equals(0)
done()
@ -125,21 +125,21 @@ o.spec("onbeforeremove", function() {
o("calls remove after onbeforeremove resolves", function(done) {
var spy = o.spy()
var vnode = {tag: "<", attrs: {onbeforeremove: remove, onremove: spy}, children: "a"}
render(root, [vnode])
render(root, [])
function remove(node, complete) {
o(node).equals(vnode)
o(root.childNodes.length).equals(1)
o(root.firstChild).equals(vnode.dom)
callAsync(function() {
o(root.childNodes.length).equals(1)
o(spy.callCount).equals(0)
complete()
o(root.childNodes.length).equals(0)
o(spy.callCount).equals(1)
@ -150,9 +150,9 @@ o.spec("onbeforeremove", function() {
o("does not set onbeforeremove as an event handler", function() {
var remove = o.spy()
var vnode = {tag: "div", attrs: {onbeforeremove: remove}, children: []}
render(root, [vnode])
o(vnode.dom.onbeforeremove).equals(undefined)
o(vnode.dom.attributes["onbeforeremove"]).equals(undefined)
})
@ -160,11 +160,11 @@ o.spec("onbeforeremove", function() {
var remove = function(vnode, done) {done()}
var vnode = {tag: "div", key: 1, attrs: {onbeforeremove: remove}}
var updated = {tag: "div", key: 1, attrs: {onbeforeremove: remove}}
render(root, [vnode])
render(root, [])
render(root, [updated])
o(vnode.dom).notEquals(updated.dom)
})
})
})