diff --git a/render/hyperscript.js b/render/hyperscript.js index 26ff753e3..7482cba79 100644 --- a/render/hyperscript.js +++ b/render/hyperscript.js @@ -36,7 +36,6 @@ function execSelector(state, vnode) { var className = hasClass ? attrs.class : attrs.className vnode.tag = state.tag - vnode.attrs = {} if (!isEmpty(state.attrs) && !isEmpty(attrs)) { var newAttrs = {} @@ -64,12 +63,7 @@ function execSelector(state, vnode) { if (hasClass) attrs.class = null - for (var key in attrs) { - if (hasOwn.call(attrs, key) && key !== "key") { - vnode.attrs = attrs - break - } - } + vnode.attrs = attrs return vnode } diff --git a/render/tests/test-hyperscript.js b/render/tests/test-hyperscript.js index 59751f44a..f688ffd4d 100644 --- a/render/tests/test-hyperscript.js +++ b/render/tests/test-hyperscript.js @@ -271,7 +271,7 @@ o.spec("hyperscript", function() { var vnode = m("div", {key:"a"}) o(vnode.tag).equals("div") - o(vnode.attrs).deepEquals({}) + o(vnode.attrs).deepEquals({key:"a"}) o(vnode.key).equals("a") }) o("handles many attrs", function() { @@ -343,7 +343,7 @@ o.spec("hyperscript", function() { var vnode = m("custom-element", {key:"a"}) o(vnode.tag).equals("custom-element") - o(vnode.attrs).deepEquals({}) + o(vnode.attrs).deepEquals({key:"a"}) o(vnode.key).equals("a") }) o("handles many attrs", function() {