mithril-vndb/render/fragment.js
Isiah Meadows 966e78bcab
Allow variadic arguments to m.fragment (#2328)
* Implement support for variadic arguments to `m.fragment`

While I was at it, I refactored the common logic out of `hyperscript`.

* Add a missed change from #2326

* Update docs + changelog [skip ci]

* Explain rationale for `hyperscriptVnode`'s calling convention

This way, it doesn't get erroneously "cleaned up" into something worse,
and so it's clearer how it'd be potentially optimized once ES5 support
is dropped.
2018-12-05 23:57:42 -05:00

12 lines
279 B
JavaScript

"use strict"
var Vnode = require("../render/vnode")
var hyperscriptVnode = require("./hyperscriptVnode")
module.exports = function() {
var vnode = hyperscriptVnode.apply(0, arguments)
vnode.tag = "["
vnode.children = Vnode.normalizeChildren(vnode.children)
return vnode
}