Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: test/debugger/debug/es8/async-function-debug-scopes.js

Issue 2898163002: Make non-Module generators only context allocate parameters. (Closed)
Patch Set: Rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Flags: --noalways-opt
6
5 var Debug = debug.Debug; 7 var Debug = debug.Debug;
6 var global_marker = 7; 8 var global_marker = 7;
7 9
8 async function thrower() { throw 'Exception'; } 10 async function thrower() { throw 'Exception'; }
9 11
10 async function test(name, func, args, handler, continuation) { 12 async function test(name, func, args, handler, continuation) {
11 var handler_called = false; 13 var handler_called = false;
12 var exception = null; 14 var exception = null;
13 15
14 function listener(event, exec_state, event_data, data) { 16 function listener(event, exec_state, event_data, data) {
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 await test( 395 await test(
394 "(AsyncFunctionExpression) Closure 1 --- resume normal", 396 "(AsyncFunctionExpression) Closure 1 --- resume normal",
395 async function(a) { let x = await 2; 397 async function(a) { let x = await 2;
396 return function() { debugger; return a; } }, [1], 398 return function() { debugger; return a; } }, [1],
397 exec_state => { 399 exec_state => {
398 CheckScopeChain([debug.ScopeType.Local, 400 CheckScopeChain([debug.ScopeType.Local,
399 debug.ScopeType.Closure, 401 debug.ScopeType.Closure,
400 debug.ScopeType.Closure, 402 debug.ScopeType.Closure,
401 debug.ScopeType.Script, 403 debug.ScopeType.Script,
402 debug.ScopeType.Global], exec_state); 404 debug.ScopeType.Global], exec_state);
403 CheckScopeContent({a:1, x: 2}, 1, exec_state); 405 CheckScopeContent({a:1}, 1, exec_state);
404 }, 406 },
405 result => result()); 407 result => result());
406 408
407 await test( 409 await test(
408 "(AsyncFunctionExpression) Closure 1 --- resume throw", 410 "(AsyncFunctionExpression) Closure 1 --- resume throw",
409 async function(a) { let x = await 2; 411 async function(a) { let x = await 2;
410 return async function() { 412 return async function() {
411 try { await thrower(); } 413 try { await thrower(); }
412 catch (e) { debugger; } return a; }; }, [1], 414 catch (e) { debugger; } return a; }; }, [1],
413 exec_state => { 415 exec_state => {
414 CheckScopeChain([debug.ScopeType.Catch, 416 CheckScopeChain([debug.ScopeType.Catch,
415 debug.ScopeType.Local, 417 debug.ScopeType.Local,
416 debug.ScopeType.Closure, 418 debug.ScopeType.Closure,
417 debug.ScopeType.Closure, 419 debug.ScopeType.Closure,
418 debug.ScopeType.Script, 420 debug.ScopeType.Script,
419 debug.ScopeType.Global], exec_state); 421 debug.ScopeType.Global], exec_state);
420 CheckScopeContent({e: 'Exception'}, 0, exec_state); 422 CheckScopeContent({e: 'Exception'}, 0, exec_state);
421 CheckScopeContent({a:1, x: 2}, 2, exec_state); 423 CheckScopeContent({a:1}, 2, exec_state);
422 }, 424 },
423 result => result()); 425 result => result());
424 426
425 await test( 427 await test(
426 "(AsyncFunctionExpression) Catch block 1", 428 "(AsyncFunctionExpression) Catch block 1",
427 async function() { try { throw 'Exception'; } catch (e) { debugger; } }, [], 429 async function() { try { throw 'Exception'; } catch (e) { debugger; } }, [],
428 exec_state => { 430 exec_state => {
429 CheckScopeChain([debug.ScopeType.Catch, 431 CheckScopeChain([debug.ScopeType.Catch,
430 debug.ScopeType.Local, 432 debug.ScopeType.Local,
431 debug.ScopeType.Closure, 433 debug.ScopeType.Closure,
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 541
540 if (scope_size < count) { 542 if (scope_size < count) {
541 print('Names found in scope:'); 543 print('Names found in scope:');
542 var names = scope.scopeObject().propertyNames(); 544 var names = scope.scopeObject().propertyNames();
543 for (var i = 0; i < names.length; i++) { 545 for (var i = 0; i < names.length; i++) {
544 print(names[i]); 546 print(names[i]);
545 } 547 }
546 } 548 }
547 assertTrue(scope_size >= count); 549 assertTrue(scope_size >= count);
548 } 550 }
OLDNEW
« no previous file with comments | « test/debugger/debug/es8/async-function-debug-evaluate.js ('k') | test/debugger/debug/regress-3225.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698