Georgii Dolzhykov
Georgii Dolzhykov
Let's use a `visited` cache only if the printer doesn't have `ignoredProperties`.
On the other hand, if nodes happen to have links like `nextSibling` that will ruin the depth-first processing anyway. I'm not sure what to do.
Or we can document `ignoredProperties`. If we add `getVisitorKeys`, `ignoredProperties` still can be used when `getVisitorKeys` isn't defined. There will be no need to remove it.
How about renaming `ignoredProperties` to `ignoredKeys`?
`nonTraversableKeys`? "Ignored" is too abstract.
I said the difference is small if `for-in` is simply replaced with `Object.keys`. But to say something definite about the `getVisitorKeys` approach, we need to benchmark a proper implementation of...
> We don't even need write test, these lines all should be able to remove I don't think it's that simple. Better not to do in this PR.
> I think it's more flexible api. It is flexible, but we don't have use cases for this flexibility, so I'm skeptical.
...or maybe we will not. Too hypothetical.
I can't imagine how print can reuse the visitor keys