Skip to content

Commit 76e0f38

Browse files
committed
fixed regression caused by throwing in Fastnode
1 parent ed402d9 commit 76e0f38

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

cocktail/core/ds/FastNode.hx

-4
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,6 @@ class FastNode<NodeClass:IFastNode<NodeClass>> implements IFastNode<NodeClass>
126126

127127
public function insertBefore(newChild:NodeClass, refChild:NodeClass):Void
128128
{
129-
if (refChild.parentNode != cast(this))
130-
{
131-
throw 'not a child node';
132-
}
133129

134130
if (firstChild == null || refChild == null)
135131
{

test/core/ds/FastNodeTest.hx

-16
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@ class FastNodeTest extends BuddySuite {
2222
childNode.parentNode.should.be(null);
2323
parentNode.firstChild.should.be(null);
2424
});
25-
it('should throw if not a child', function () {
26-
var parentNode = new TestNode();
27-
var anotherNode = new TestNode();
28-
29-
parentNode.removeChild.bind(anotherNode)
30-
.should.throwValue('not a child node');
31-
});
3225
});
3326

3427
describe('#appendChild', function () {
@@ -61,15 +54,6 @@ class FastNodeTest extends BuddySuite {
6154
firstChildNode.nextSibling.should.be(null);
6255
firstChildNode.previousSibling.should.be(childNode);
6356
});
64-
65-
it('should throw if ref node is not a child', function () {
66-
var parentNode = new TestNode();
67-
var childNode = new TestNode();
68-
var anotherNode = new TestNode();
69-
70-
parentNode.insertBefore.bind(childNode, anotherNode)
71-
.should.throwValue('not a child node');
72-
});
7357
});
7458
});
7559
}

0 commit comments

Comments
 (0)