| OLD | NEW |
| 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: --harmony-async-await --expose-debug-as debug | 5 // Flags: --harmony-async-await --expose-debug-as debug |
| 6 | 6 |
| 7 var Debug = debug.Debug; | 7 var Debug = debug.Debug; |
| 8 | 8 |
| 9 var AsyncFunction = (async function() {}).constructor; | 9 var AsyncFunction = (async function() {}).constructor; |
| 10 | 10 |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 for (var i = 0; i < scopes.length && i < length; i++) { | 494 for (var i = 0; i < scopes.length && i < length; i++) { |
| 495 var scope = fast_all_scopes[length - i - 1]; | 495 var scope = fast_all_scopes[length - i - 1]; |
| 496 assertTrue(scope.isScope()); | 496 assertTrue(scope.isScope()); |
| 497 assertEquals(scopes[scopes.length - i - 1], scope.scopeType()); | 497 assertEquals(scopes[scopes.length - i - 1], scope.scopeType()); |
| 498 } | 498 } |
| 499 } | 499 } |
| 500 | 500 |
| 501 // Check that the scope chain contains the expected types of scopes. | 501 // Check that the scope chain contains the expected types of scopes. |
| 502 function CheckScopeChain(scopes, exec_state) { | 502 function CheckScopeChain(scopes, exec_state) { |
| 503 var all_scopes = exec_state.frame().allScopes(); | 503 var all_scopes = exec_state.frame().allScopes(); |
| 504 assertEquals(scopes.length, exec_state.frame().scopeCount()); | |
| 505 assertEquals( | 504 assertEquals( |
| 506 scopes.length, all_scopes.length, "FrameMirror.allScopes length"); | 505 scopes.length, all_scopes.length, "FrameMirror.allScopes length"); |
| 507 for (var i = 0; i < scopes.length; i++) { | 506 for (var i = 0; i < scopes.length; i++) { |
| 508 var scope = exec_state.frame().scope(i); | 507 var scope = exec_state.frame().scope(i); |
| 509 assertTrue(scope.isScope()); | 508 assertTrue(scope.isScope()); |
| 510 assertEquals(scopes[i], scope.scopeType()); | 509 assertEquals(scopes[i], scope.scopeType()); |
| 511 assertScopeMirrorEquals(all_scopes[i], scope); | 510 assertScopeMirrorEquals(all_scopes[i], scope); |
| 512 | 511 |
| 513 // Check the global object when hitting the global scope. | 512 // Check the global object when hitting the global scope. |
| 514 if (scopes[i] == debug.ScopeType.Global) { | 513 if (scopes[i] == debug.ScopeType.Global) { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 assertTrue(response.body.object.ref < 0); | 607 assertTrue(response.body.object.ref < 0); |
| 609 } else { | 608 } else { |
| 610 assertTrue(response.body.object.ref >= 0); | 609 assertTrue(response.body.object.ref >= 0); |
| 611 } | 610 } |
| 612 var found = false; | 611 var found = false; |
| 613 for (var i = 0; i < response.refs.length && !found; i++) { | 612 for (var i = 0; i < response.refs.length && !found; i++) { |
| 614 found = response.refs[i].handle == response.body.object.ref; | 613 found = response.refs[i].handle == response.body.object.ref; |
| 615 } | 614 } |
| 616 assertTrue(found, "Scope object " + response.body.object.ref + " not found"); | 615 assertTrue(found, "Scope object " + response.body.object.ref + " not found"); |
| 617 } | 616 } |
| OLD | NEW |