| <!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 |
| {expression: `iter = 'alpha'[Symbol.iterator]()`}, |
| {expression: `iter.__proto__.next = function(){}; iter`}, |
| |
| // Map |
| {expression: `map = new Map; map.set(1, 2); map.set('key', 'value'); iter = map[Symbol.iterator]()`}, |
| {expression: `iter.__proto__.next = function(){}; iter`}, |
| |
| // Set |
| {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 (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> |