Debian Codegraph @

rhino/testsrc/doctests/757410.doctest

raw
1 // This Source Code Form is subject to the terms of the Mozilla Public
2 // License, v. 2.0. If a copy of the MPL was not distributed with this
3 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
5 // https://bugzilla.mozilla.org/show_bug.cgi?id=757410
6
7 js> version(180)
8 0
9 js> function gen() {
10 > [yield 1];
11 > ({x: yield 2});
12 > }
13 js> var g = gen()
14 js> g.next() == 1 && g.next() == 2
15 true
16 js> try {g.next()} catch(e) {e instanceof StopIteration}
17 true