don't allow visitor methods to return a new node to replace
This commit is contained in:
parent
13773e3c02
commit
6898cf83d0
@ -23,7 +23,7 @@ export function call(key) {
|
||||
var replacement = fn.call(this, this, this.state);
|
||||
|
||||
if (replacement) {
|
||||
this.replaceWith(replacement, true);
|
||||
throw new Error("Unexpected return value from visitor method");
|
||||
}
|
||||
|
||||
if (this.shouldStop || this.shouldSkip || this.removed) return;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user