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: michael@0: var std_iterator = (function() { michael@0: try { michael@0: for (var _ of new Proxy({}, { get: function(_, name) { throw name; } })) michael@0: break; michael@0: } catch (name) { michael@0: return name; michael@0: } michael@0: throw 'wat'; michael@0: })(); michael@0: michael@0: function assertFalse(a) { assertEq(a, false) } michael@0: function assertTrue(a) { assertEq(a, true) } michael@0: function assertNotEq(found, not_expected) { assertFalse(found === expected) } michael@0: function assertIteratorResult(result, value, done) { michael@0: assertDeepEq(result.value, value); michael@0: assertEq(result.done, done); michael@0: } michael@0: function assertIteratorNext(iter, value) { michael@0: assertIteratorResult(iter.next(), value, false); michael@0: } michael@0: function assertIteratorDone(iter, value) { michael@0: assertIteratorResult(iter.next(), value, true); michael@0: }