maacl/js-tree-cursor — comment on commit 76f39c0d5973ccdb6f3649c69af44c31c5f6879a
File:  line 0
By maacl:

Thanks for the feedback, and sure i will give it a go.

Did the test coverage look OK?

/mac
On Sunday, February 5, 2012, Danny Yoo <
reply@reply.github.com>
wrote:
> Not sure I like this yet. The dynamic lookup of attributes should be
outside the inner loop.
>
> The iteration with chain() is an idea, but the attribute lookup can be
eliminated. e.g.
>
> TreeCursor.prototype.nUp = function(i) {
> return this.chain(this.up, i);
> };
>
> TreeCursor.prototype.chain = function(f, i) {
> var n = this;
> while(i--) { n = f.call(n); }
> return n;
> };
>
> // ...
>
>
> Similar idea for the canChain work. Rather than use the name of the
function as an argument, use the function itself. The up-side is that this
approach should be able to avoid all the string slicing.
>
> Do you want to try your hand at it first?
>
> ---
> Reply to this email directly or view it on GitHub:
>
https://github.com/maacl/js-tree-cursor/commit/76f39c0d5973ccdb6f3649c69af44c31c5f6879a#commitcomment-933934
>