(content, number, exec_state)
| 84 | // Check that the content of the scope is as expected. For functions just check |
| 85 | // that there is a function. |
| 86 | function CheckScopeContent(content, number, exec_state) { |
| 87 | var scope = exec_state.frame().scope(number); |
| 88 | var count = 0; |
| 89 | for (var p in content) { |
| 90 | var property_mirror = scope.scopeObject().property(p); |
| 91 | assertFalse(property_mirror.isUndefined(), |
| 92 | 'property ' + p + ' not found in scope'); |
| 93 | assertEquals(content[p], property_mirror.value().value(), |
| 94 | 'property ' + p + ' has unexpected value'); |
| 95 | count++; |
| 96 | } |
| 97 | |
| 98 | // 'arguments' and might be exposed in the local and closure scope. Just |
| 99 | // ignore this. |
| 100 | var scope_size = scope.scopeObject().properties().length; |
| 101 | if (!scope.scopeObject().property('arguments').isUndefined()) { |
| 102 | scope_size--; |
| 103 | } |
| 104 | // Skip property with empty name. |
| 105 | if (!scope.scopeObject().property('').isUndefined()) { |
| 106 | scope_size--; |
| 107 | } |
| 108 | |
| 109 | if (scope_size < count) { |
| 110 | print('Names found in scope:'); |
| 111 | var names = scope.scopeObject().propertyNames(); |
| 112 | for (var i = 0; i < names.length; i++) { |
| 113 | print(names[i]); |
| 114 | } |
| 115 | } |
| 116 | assertTrue(scope_size >= count); |
| 117 | } |
| 118 | |
| 119 | |
| 120 | // Simple empty local scope. |
no test coverage detected