blob: f56b842e134a6c837ac789a37f4fb1541228b285 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
<script src="resources/remote-object-utilities.js"></script>
<script>
function test()
{
let steps = [
// String Iterator
{expression: `iter = 'alpha'[Symbol.iterator]()`},
{expression: `iter.__proto__.next = function(){}; iter`},
// Map Iterator
{expression: `map = new Map; map.set(1, 2); map.set('key', 'value'); iter = map[Symbol.iterator]()`},
{expression: `iter.__proto__.next = function(){}; iter`},
// Set Iterator
{expression: `set = new Set; for (var i = 0; i <= 100; i++) set.add(i); iter = set[Symbol.iterator]()`},
{expression: `iter.__proto__.next = function(){}; iter`},
// Array Iterator (array and arguments)
{expression: `arrayIter = [1,2,3][Symbol.iterator]()`},
{expression: `x = undefined; (function() { x = arguments; })(3, 'arg'); argumentsIter = x[Symbol.iterator]()`},
{expression: `arrayIter.__proto__.next = function(){}; arrayIter`},
{expression: `argumentsIter.__proto__.next = function(){}; argumentsIter`},
];
if (!window.WI) {
window.steps = steps;
return;
}
runSteps(steps);
}
</script>
</head>
<body onload="runTest(); runInBrowserTest();"></body>
</html>