OLD | NEW |
1 <script> | 1 <script> |
2 function childNodeCount(parent) { | 2 import "dart:sky"; |
3 var count = 0; | |
4 for (var node = parent.firstChild; node; node = node.nextSibling) | |
5 ++count; | |
6 return count; | |
7 } | |
8 | 3 |
9 function childElementCount(parent) { | 4 int childNodeCount(parent) { |
10 var count = 0; | 5 int count = 0; |
11 for (var element = parent.firstElementChild; element; element = element.next
ElementSibling) | 6 for (Node node = parent.firstChild; node != null; node = node.nextSibling) |
12 ++count; | 7 ++count; |
13 return count; | 8 return count; |
14 } | 9 } |
15 | 10 |
16 module.exports = { | 11 int childElementCount(parent) { |
17 childNodeCount: childNodeCount, | 12 int count = 0; |
18 childElementCount: childElementCount, | 13 for (Element element = parent.firstElementChild; element != null; element = el
ement.nextElementSibling) |
19 }; | 14 ++count; |
20 </script> | 15 return count; |
| 16 } |
| 17 </script> |
OLD | NEW |