chromium/third_party/blink/web_tests/fast/js/iterable-object.html

<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test.js"></script>
</head>
<body>
<script>
description('Test ES6 iterator works with DOM objects.');

shouldBeUndefined('internals.iterator');
for (var value of internals) {
    debug('value = ' + value);
}

for (var value of internals[Symbol.iterator]()) {
    debug('value = ' + value);
}

for (var key of internals.keys()) {
    debug('key = ' + key);
}

for (var value of internals.values()) {
    debug('value = ' + value);
}

for (var entry of internals.entries()) {
    debug('entry = ' + entry);
}

shouldThrow('internals.forEach("not a function")');
shouldThrow('internals.forEach(function () { debug("callback called"); throw Error("stop!"); })');
internals.forEach(function (value, key, object) {
    debug(this + ', ' + value + ', ' + key + ', ' + object);
}, 'thisArg');
internals.forEach(function (value) {
    debug(value + ': ' + this);
});
internals.forEach(function (value) {
    debug(value + ': ' + this);
}, null);
internals.forEach(function (value) {
    'use strict';
    debug(value + ': ' + this);
});
internals.forEach(function (value) {
    'use strict';
    debug(value + ': ' + this);
}, null);
internals.forEach(function (value) {
    'use strict';
    debug(value + ': ' + typeof this);
}, 3.14);

</script>
</body>
</html>