Commit 09ff6859d5f3bbe1d6d1bb575c6d2cf7e546c031
Work without destructuring assignment
Support node v5cel committed on 10/22/2016, 8:37:40 PM
Parent: 2be98937cd98f834eb1c89fd7cc15df13c8b2acb
Files changed
index.js | changed |
index.js | ||
---|---|---|
@@ -7,19 +7,14 @@ | ||
7 | 7 … | var createAttributes = require('./lib/create-attributes') |
8 | 8 … | |
9 | 9 … | module.exports = h |
10 | 10 … | |
11 | -function h () { | |
12 | - var tagName, props, children | |
13 | - if (arguments.length === 3) [ tagName, props, children ] = arguments | |
14 | - | |
15 | - if (arguments.length === 2) { | |
16 | - if (isChild(arguments[1])) [ tagName, children ] = arguments | |
17 | - else [ tagName, props, children ] = arguments | |
11 … | +function h (tagName, props, children) { | |
12 … | + if (arguments.length === 2 && isChild(props)) { | |
13 … | + children = props | |
14 … | + props = undefined | |
18 | 15 … | } |
19 | 16 … | |
20 | - if (arguments.length === 1) [ tagName ] = arguments | |
21 | - | |
22 | 17 … | props = defined(props, {}) |
23 | 18 … | // children = defined(children, []) |
24 | 19 … | |
25 | 20 … | return cat([ |
Built with git-ssb-web