evilhackerdude/syntux — comment on commit 2aebd2560d3d9978bf86e2976fdb20032b6855dd
File: lib/token.js line 58
By felixge:

The _zeToken property is not supposed to be used internally. I just added it so you can do console.log(token._zeToken) to discover things that the token class may be still be missing and properly add them.

Doing something like the above breaks the abstraction, and will for example fail on tokens that were inserted by other plugins.

So this method should really ask the parent tokens object to answer this question. The tokens object should do that by traversing the tree.

If we find that this becomes a performance problem, we can always pre-compute offsets in the insert/remove methods, but for now it should be plenty fast.