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

Commit 5bb221b

Browse files
committed
Merge pull request #265 from labriola/patch-1
Update Node.js
2 parents 0f72cea + 895860f commit 5bb221b

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

src/wrappers/Node.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@
373373
},
374374

375375
hasChildNodes: function() {
376-
return this.firstChild === null;
376+
return this.firstChild !== null;
377377
},
378378

379379
/** @type {Node} */

test/js/Node.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,4 +186,16 @@ suite('Node', function() {
186186

187187
expectStructure(host2, {});
188188
});
189+
190+
test('hasChildNodes without a shadow root', function() {
191+
var div = document.createElement('div');
192+
193+
assert.isFalse(div.hasChildNodes(), 'should be false with no children');
194+
195+
div.innerHTML = '<span></span>';
196+
assert.isTrue(div.hasChildNodes(), 'should be true with a single child');
197+
198+
div.innerHTML = '<span></span><ul></ul>';
199+
assert.isTrue(div.hasChildNodes(), 'should be true with multiple children');
200+
});
189201
});

0 commit comments

Comments
 (0)