add toString to allow reflection of original traversal methods when wrapping for state
This commit is contained in:
parent
8280e18ed4
commit
f1f42164fc
@ -174,9 +174,11 @@ function wrapWithState(oldVisitor, state) {
|
||||
if (!Array.isArray(fns)) continue;
|
||||
|
||||
fns = fns.map(function (fn) {
|
||||
return function (path) {
|
||||
let newFn = function (path) {
|
||||
return fn.call(state, path, state);
|
||||
};
|
||||
newFn.toString = () => fn.toString();
|
||||
return newFn;
|
||||
});
|
||||
|
||||
newVisitor[key] = fns;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user