inherit first replacement node from the current node

This commit is contained in:
Sebastian McKenzie 2015-03-28 00:22:59 +11:00
parent ed74ccaa7d
commit bd052aea50

View File

@ -210,7 +210,7 @@ export default class TraversalPath {
if (!node) throw new Error(`Falsy node passed to \`path.replaceWithMultiple()\` with the index of ${i}`);
}
//
t.inherits(nodes[0], this.node);
this.container[this.key] = null;
this.insertAfter(nodes);
@ -219,7 +219,7 @@ export default class TraversalPath {
replaceWith(replacement, arraysAllowed) {
if (this.removed) {
throw new Error("Trying to replace a node that we've removed");
throw new Error("You can't replace this node, we've already removed it");
}
if (!replacement) {