gecko-dev/devtools/client/webconsole/test/test-bug-632347-iterators-generators.html

30 lines
654 B
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Web Console test for bug 632347 - generators</title>
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<script type="application/javascript">
(function(){
function* genFunc() {
var a = 5;
while (a < 10) {
yield a++;
}
}
window._container = {};
_container.gen1 = genFunc();
_container.gen1.next();
_container.gen2 = (function* () { for (let i = 3; i <= 15; ++i) yield i * 2; })();
})();
</script>
</head>
<body>
<p>Web Console test for bug 632347 - generators.</p>
</body>
</html>