OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 debugger; | 369 debugger; |
370 } | 370 } |
371 } | 371 } |
372 | 372 |
373 listener_delegate = function(exec_state) { | 373 listener_delegate = function(exec_state) { |
374 CheckScopeChain([debug.ScopeType.Block, | 374 CheckScopeChain([debug.ScopeType.Block, |
375 debug.ScopeType.Local, | 375 debug.ScopeType.Local, |
376 debug.ScopeType.Global], exec_state); | 376 debug.ScopeType.Global], exec_state); |
377 CheckScopeContent({x:'y'}, 0, exec_state); | 377 CheckScopeContent({x:'y'}, 0, exec_state); |
378 // The function scope contains a temporary iteration variable. | 378 // The function scope contains a temporary iteration variable. |
379 CheckScopeContent({x:'y'}, 1, exec_state); | 379 CheckScopeContent({'.for.x':'y'}, 1, exec_state); |
380 }; | 380 }; |
381 for_loop_1(); | 381 for_loop_1(); |
382 EndTest(); | 382 EndTest(); |
383 | 383 |
384 | 384 |
385 // For-in loop over the keys of an object with a block scoped let variable | 385 // For-in loop over the keys of an object with a block scoped let variable |
386 // shadowing the iteration variable. | 386 // shadowing the iteration variable. |
387 BeginTest("For loop 2"); | 387 BeginTest("For loop 2"); |
388 | 388 |
389 function for_loop_2() { | 389 function for_loop_2() { |
390 for (let x in {y:undefined}) { | 390 for (let x in {y:undefined}) { |
391 let x = 3; | 391 let x = 3; |
392 debugger; | 392 debugger; |
393 } | 393 } |
394 } | 394 } |
395 | 395 |
396 listener_delegate = function(exec_state) { | 396 listener_delegate = function(exec_state) { |
397 CheckScopeChain([debug.ScopeType.Block, | 397 CheckScopeChain([debug.ScopeType.Block, |
398 debug.ScopeType.Block, | 398 debug.ScopeType.Block, |
399 debug.ScopeType.Local, | 399 debug.ScopeType.Local, |
400 debug.ScopeType.Global], exec_state); | 400 debug.ScopeType.Global], exec_state); |
401 CheckScopeContent({x:3}, 0, exec_state); | 401 CheckScopeContent({x:3}, 0, exec_state); |
402 CheckScopeContent({x:'y'}, 1, exec_state); | 402 CheckScopeContent({x:'y'}, 1, exec_state); |
403 // The function scope contains a temporary iteration variable. | 403 // The function scope contains a temporary iteration variable. |
404 CheckScopeContent({x:'y'}, 2, exec_state); | 404 CheckScopeContent({'.for.x':'y'}, 2, exec_state); |
405 }; | 405 }; |
406 for_loop_2(); | 406 for_loop_2(); |
407 EndTest(); | 407 EndTest(); |
408 | 408 |
409 | 409 |
410 // Simple for loop. | 410 // Simple for loop. |
411 BeginTest("For loop 3"); | 411 BeginTest("For loop 3"); |
412 | 412 |
413 function for_loop_3() { | 413 function for_loop_3() { |
414 for (let x = 3; x < 4; ++x) { | 414 for (let x = 3; x < 4; ++x) { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 | 461 |
462 listener_delegate = function(exec_state) { | 462 listener_delegate = function(exec_state) { |
463 CheckScopeChain([debug.ScopeType.Block, | 463 CheckScopeChain([debug.ScopeType.Block, |
464 debug.ScopeType.Local, | 464 debug.ScopeType.Local, |
465 debug.ScopeType.Global], exec_state); | 465 debug.ScopeType.Global], exec_state); |
466 CheckScopeContent({x:3,y:5}, 0, exec_state); | 466 CheckScopeContent({x:3,y:5}, 0, exec_state); |
467 CheckScopeContent({}, 1, exec_state); | 467 CheckScopeContent({}, 1, exec_state); |
468 }; | 468 }; |
469 for_loop_5(); | 469 for_loop_5(); |
470 EndTest(); | 470 EndTest(); |
OLD | NEW |