Index: test/mjsunit/debug-scopes.js |
diff --git a/test/mjsunit/debug-scopes.js b/test/mjsunit/debug-scopes.js |
index 57adf236ffbafb3adaf463cfafd5ae7a167aa121..804a898cf36ca3109da5e9d77127acdebfec94a7 100644 |
--- a/test/mjsunit/debug-scopes.js |
+++ b/test/mjsunit/debug-scopes.js |
@@ -71,16 +71,32 @@ function BeginTest(name) { |
// Check result of a test. |
function EndTest() { |
assertTrue(listener_called, "listerner not called for " + test_name); |
- assertNull(exception, test_name); |
+ assertNull(exception, test_name + " / " + exception); |
end_test_count++; |
} |
// Check that two scope are the same. |
-function CheckScopeMirrors(scope1, scope2) { |
+function assertScopeMirrorEquals(scope1, scope2) { |
assertEquals(scope1.scopeType(), scope2.scopeType()); |
assertEquals(scope1.frameIndex(), scope2.frameIndex()); |
assertEquals(scope1.scopeIndex(), scope2.scopeIndex()); |
+ assertPropertiesEqual(scope1.scopeObject().value(), scope2.scopeObject().value()); |
+} |
+ |
+function CheckFastAllScopes(scopes, exec_state) |
+{ |
+ var fast_all_scopes = exec_state.frame().allScopes(true); |
+ var length = fast_all_scopes.length; |
+ assertTrue(scopes.length >= length); |
+ for (var i = 0; i < scopes.length && i < length; i++) { |
+ var scope = fast_all_scopes[length - i - 1]; |
+ assertTrue(scope.isScope()); |
+ var index = scopes.length - i - 1; |
+ assertEquals(scope.scopeType(), scopes[index]); |
+ scope.scope_index_ = index; // to pass the following assert |
+ assertScopeMirrorEquals(scope, exec_state.frame().scope(index)); |
+ } |
} |
@@ -93,7 +109,7 @@ function CheckScopeChain(scopes, exec_state) { |
var scope = exec_state.frame().scope(i); |
assertTrue(scope.isScope()); |
assertEquals(scopes[i], scope.scopeType()); |
- CheckScopeMirrors(all_scopes[i], scope); |
+ assertScopeMirrorEquals(all_scopes[i], scope); |
// Check the global object when hitting the global scope. |
if (scopes[i] == debug.ScopeType.Global) { |
@@ -102,6 +118,7 @@ function CheckScopeChain(scopes, exec_state) { |
assertPropertiesEqual(this, scope.scopeObject().value()); |
} |
} |
+ CheckFastAllScopes(scopes, exec_state); |
// Get the debug command processor. |
var dcp = exec_state.debugCommandProcessor("unspecified_running_state"); |