From bd052aea50446ae2366df9c69d36f056187519e7 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sat, 28 Mar 2015 00:22:59 +1100 Subject: [PATCH] inherit first replacement node from the current node --- src/babel/traversal/path/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/babel/traversal/path/index.js b/src/babel/traversal/path/index.js index c5563e8cca..aaa7227058 100644 --- a/src/babel/traversal/path/index.js +++ b/src/babel/traversal/path/index.js @@ -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) {