On Thu, May 10, 2012 at 2:16 PM, Axel Rauschmayer <[email protected]> wrote:
> function* iter() {
>
> if (this.left) {
>
> yield* iter(this.left);
I'm confused how you expect this to work. iter does not take a parameter.
> }
>
> yield this.label;
>
> if (this.right) {
>
> yield* iter(this.right);
>
> }
>
> }
>
>
> Tree.prototype.visit = visit;
>
> Tree.prototype[iterator] = iter;
Maybe you intended to write something like this?
function* iter(tree) {
if (tree.left) {
yield* iter(tree.left);
}
yield tree.label;
if (tree.right) {
yield* iter(tree.right);
}
}
--
erik
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss