rhino/testsrc/doctests/iteratorKeys.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 | js> version(170) |
| 6 | 0 |
| 7 | js> var foo = { |
| 8 | > __iterator__ : function(onlyKeys) { |
| 9 | > print(onlyKeys); |
| 10 | > yield [0, "a"]; |
| 11 | > } |
| 12 | > }; |
| 13 | js> for each (let f in foo) {} |
| 14 | false |
| 15 | js> for (let f in foo) {} |
| 16 | true |