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

Commit

Permalink
fix dom stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelw committed Mar 17, 2014
1 parent e843e74 commit a7e91b2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions benchmark/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ Node.prototype = {
},

removeChild: function(node) {
if (node.parentNode != this)
return;
if (node.parentNode != this) {
throw Error('NotFoundError');
}
if (!node.previousSibling && !node.nextSibling) {
this.firstChild = null;
this.lastChild = null;
Expand All @@ -90,6 +91,8 @@ Node.prototype = {
node.parentNode = null;
node.previousSibling = null;
node.nextSibling = null;

return node;
},
insertBefore: function(node, otherNode) {
if (node.parentNode)
Expand Down Expand Up @@ -405,4 +408,4 @@ function HTMLBaseElement(owner, tagName) {
}
HTMLBaseElement.prototype = {
__proto__: HTMLElement.prototype
};
};

0 comments on commit a7e91b2

Please sign in to comment.