Skip to content

Commit

Permalink
Merge 8fd0560 into 947ecf9
Browse files Browse the repository at this point in the history
  • Loading branch information
ipluser committed Mar 31, 2017
2 parents 947ecf9 + 8fd0560 commit e26857d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion virtual-hyperscript/index.js
Expand Up @@ -116,7 +116,7 @@ function isChild(x) {
}

function isChildren(x) {
return typeof x === 'string' || isArray(x) || isChild(x);
return typeof x === 'string' || typeof x === 'number' || isArray(x) || isChild(x);
}

function UnexpectedVirtualElement(data) {
Expand Down
10 changes: 10 additions & 0 deletions virtual-hyperscript/test/h.js
Expand Up @@ -188,3 +188,13 @@ test("h with two ids", function (assert) {

assert.end()
})

test("h with Number", function (assert) {
var node = h("div", 1)
var node2 = h("div", [1])

assert.equal(node.children[0].text, "1")
assert.equal(node2.children[0].text, "1")

assert.end()
})

0 comments on commit e26857d

Please sign in to comment.