Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Merge pull request #265 from labriola/patch-1
Browse files Browse the repository at this point in the history
Update Node.js
  • Loading branch information
arv committed Oct 9, 2013
2 parents 0f72cea + 895860f commit 5bb221b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/wrappers/Node.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@
},

hasChildNodes: function() {
return this.firstChild === null;
return this.firstChild !== null;
},

/** @type {Node} */
Expand Down
12 changes: 12 additions & 0 deletions test/js/Node.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,16 @@ suite('Node', function() {

expectStructure(host2, {});
});

test('hasChildNodes without a shadow root', function() {
var div = document.createElement('div');

assert.isFalse(div.hasChildNodes(), 'should be false with no children');

div.innerHTML = '<span></span>';
assert.isTrue(div.hasChildNodes(), 'should be true with a single child');

div.innerHTML = '<span></span><ul></ul>';
assert.isTrue(div.hasChildNodes(), 'should be true with multiple children');
});
});

0 comments on commit 5bb221b

Please sign in to comment.