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

Commit 41b5434

Browse files
committed
Merge pull request #442 from arv/normalize-typo
Fix typo in normalize
2 parents 9d2bdaa + 2382e91 commit 41b5434

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/wrappers/Node.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@
696696
} else {
697697
if (modNode && remNodes.length) {
698698
modNode.data += s;
699-
cleanUpNodes(remNodes);
699+
cleanupNodes(remNodes);
700700
}
701701
remNodes = [];
702702
s = '';

test/js/Node.js

+14-1
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,6 @@ suite('Node', function() {
368368
assert.equal(span.firstChild.textContent, 'buzzquux');
369369
assert.equal(span.nextSibling, div.lastChild);
370370
assert.equal(div.lastChild.textContent, 'bar\n');
371-
372371
});
373372

374373
test('normalize with shadowroot', function() {
@@ -392,6 +391,20 @@ suite('Node', function() {
392391
assert.equal(sr.firstChild.nextSibling.textContent, 'quux');
393392
});
394393

394+
test('normalize - issue 441', function() {
395+
var div = document.createElement('div');
396+
div.appendChild(document.createTextNode('a'));
397+
div.appendChild(document.createTextNode('b'));
398+
div.appendChild(document.createElement('span'));
399+
div.appendChild(document.createTextNode('c'));
400+
div.appendChild(document.createTextNode('d'));
401+
402+
div.normalize();
403+
404+
assert.equal(div.textContent, 'abcd');
405+
assert.equal(div.childNodes.length, 3);
406+
});
407+
395408
test('appendChild last and first', function() {
396409
var a = document.createElement('a');
397410
a.innerHTML = '<b></b>';

0 commit comments

Comments
 (0)