(minimum_content, number, exec_state)
| 131 | // Check that the scope contains at least minimum_content. For functions just |
| 132 | // check that there is a function. |
| 133 | function CheckScopeContent(minimum_content, number, exec_state) { |
| 134 | var scope = exec_state.frame().scope(number); |
| 135 | var minimum_count = 0; |
| 136 | for (var p in minimum_content) { |
| 137 | var property_mirror = scope.scopeObject().property(p); |
| 138 | assertFalse(property_mirror.isUndefined(), |
| 139 | 'property ' + p + ' not found in scope'); |
| 140 | assertEquals(minimum_content[p], property_mirror.value().value(), |
| 141 | 'property ' + p + ' has unexpected value'); |
| 142 | minimum_count++; |
| 143 | } |
| 144 | |
| 145 | // 'arguments' and might be exposed in the local and closure scope. Just |
| 146 | // ignore this. |
| 147 | var scope_size = scope.scopeObject().properties().length; |
| 148 | if (!scope.scopeObject().property('arguments').isUndefined()) { |
| 149 | scope_size--; |
| 150 | } |
| 151 | // Ditto for 'this'. |
| 152 | if (!scope.scopeObject().property('this').isUndefined()) { |
| 153 | scope_size--; |
| 154 | } |
| 155 | // Temporary variables introduced by the parser have not been materialized. |
| 156 | assertTrue(scope.scopeObject().property('').isUndefined()); |
| 157 | |
| 158 | if (scope_size < minimum_count) { |
| 159 | print('Names found in scope:'); |
| 160 | var names = scope.scopeObject().propertyNames(); |
| 161 | for (var i = 0; i < names.length; i++) { |
| 162 | print(names[i]); |
| 163 | } |
| 164 | } |
| 165 | assertTrue(scope_size >= minimum_count); |
| 166 | } |
| 167 | |
| 168 | // Check that the scopes have positions as expected. |
| 169 | function CheckScopeChainPositions(positions, exec_state) { |
no test coverage detected