From 5ad029e0929f7d37c06cc6bc93cf55bea93cafe0 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Thu, 12 Jan 2012 01:30:36 -0500 Subject: [PATCH] Moo. --- common/modules/base.jsm | 9 ++++++++- common/modules/highlight.jsm | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/common/modules/base.jsm b/common/modules/base.jsm index 9214ed03..ff4a7b4a 100644 --- a/common/modules/base.jsm +++ b/common/modules/base.jsm @@ -1571,10 +1571,17 @@ const Iter = Class("Iter", { this.iter = iter; if ("__iterator__" in iter) this.iter = iter.__iterator__(); + + if (this.iter.finalize) + this.finalize = function finalize() this.iter.finalize.apply(this.iter, arguments); }, + next: function next() this.iter.next(), + + send: function send() this.iter.send.apply(this.iter, arguments), + __iterator__: function () this.iter -}) +}); /** * Array utility methods. diff --git a/common/modules/highlight.jsm b/common/modules/highlight.jsm index 80831e6c..7d6cfaf0 100644 --- a/common/modules/highlight.jsm +++ b/common/modules/highlight.jsm @@ -101,7 +101,7 @@ var Highlights = Module("Highlight", { keys: function keys() Object.keys(this.highlight).sort(), __iterator__: function () values(this.highlight).sort(function (a, b) String.localeCompare(a.class, b.class)) - .iterValues().__iterator__(), + .iterValues(), _create: function _create(agent, args) { let obj = Highlight.apply(Highlight, args);