Index: test/mjsunit/debug-scopes.js |
diff --git a/test/mjsunit/debug-scopes.js b/test/mjsunit/debug-scopes.js |
index 942bd2bb073804571bf39b01db88b07d25f44479..57adf236ffbafb3adaf463cfafd5ae7a167aa121 100644 |
--- a/test/mjsunit/debug-scopes.js |
+++ b/test/mjsunit/debug-scopes.js |
@@ -76,13 +76,24 @@ function EndTest() { |
} |
+// Check that two scope are the same. |
+function CheckScopeMirrors(scope1, scope2) { |
+ assertEquals(scope1.scopeType(), scope2.scopeType()); |
+ assertEquals(scope1.frameIndex(), scope2.frameIndex()); |
+ assertEquals(scope1.scopeIndex(), scope2.scopeIndex()); |
+} |
+ |
+ |
// Check that the scope chain contains the expected types of scopes. |
function CheckScopeChain(scopes, exec_state) { |
+ var all_scopes = exec_state.frame().allScopes(); |
assertEquals(scopes.length, exec_state.frame().scopeCount()); |
+ assertEquals(scopes.length, all_scopes.length, "FrameMirror.allScopes length"); |
for (var i = 0; i < scopes.length; i++) { |
var scope = exec_state.frame().scope(i); |
assertTrue(scope.isScope()); |
assertEquals(scopes[i], scope.scopeType()); |
+ CheckScopeMirrors(all_scopes[i], scope); |
// Check the global object when hitting the global scope. |
if (scopes[i] == debug.ScopeType.Global) { |