michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: // Library file for tests to load. michael@0: michael@0: function Range(start, stop) { michael@0: this.i = start; michael@0: this.stop = stop; michael@0: } michael@0: Range.prototype = { michael@0: __iterator__: function() this, michael@0: next: function() { michael@0: if (this.i >= this.stop) michael@0: throw StopIteration; michael@0: return this.i++; michael@0: } michael@0: }; michael@0: michael@0: function range(start, stop) { michael@0: return new Range(start, stop); michael@0: }