Skip to content

Commit

Permalink
默认值 #51
Browse files Browse the repository at this point in the history
  • Loading branch information
army8735 committed Sep 8, 2018
1 parent 91af986 commit da91c31
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build/VirtualDom.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ var VirtualDom = function (_Element) {
_classCallCheck(this, VirtualDom);

// 自闭合标签不能有children
if (_selfClose2.default.hasOwnProperty(name) && children.length) {
if (_selfClose2.default.hasOwnProperty(name) && children && children.length) {
throw new Error('self-close tag can not has children: ' + name);
}

Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/VirtualDom.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function __findEq(name, child, res, first) {
class VirtualDom extends Element {
constructor(uid, name, props, children) {
// 自闭合标签不能有children
if(selfClose.hasOwnProperty(name) && children.length) {
if(selfClose.hasOwnProperty(name) && children && children.length) {
throw new Error('self-close tag can not has children: ' + name);
}
super(uid, name, props, children);
Expand Down
2 changes: 1 addition & 1 deletion web/VirtualDom.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ var VirtualDom = function (_Element) {
_classCallCheck(this, VirtualDom);

// 自闭合标签不能有children
if (_selfClose2.default.hasOwnProperty(name) && children.length) {
if (_selfClose2.default.hasOwnProperty(name) && children && children.length) {
throw new Error('self-close tag can not has children: ' + name);
}

Expand Down

0 comments on commit da91c31

Please sign in to comment.