(content, number, exec_state)
| 100 | // Check that the content of the scope is as expected. For functions just check |
| 101 | // that there is a function. |
| 102 | function CheckScopeContent(content, number, exec_state) { |
| 103 | var scope = exec_state.frame().scope(number); |
| 104 | var count = 0; |
| 105 | for (var p in content) { |
| 106 | var property_mirror = scope.scopeObject().property(p); |
| 107 | if (property_mirror.isUndefined()) { |
| 108 | print('property ' + p + ' not found in scope'); |
| 109 | } |
| 110 | assertFalse(property_mirror.isUndefined(), |
| 111 | 'property ' + p + ' not found in scope'); |
| 112 | assertEquals(content[p], property_mirror.value().value(), |
| 113 | 'property ' + p + ' has unexpected value'); |
| 114 | count++; |
| 115 | } |
| 116 | |
| 117 | // 'arguments' and might be exposed in the local and closure scope. Just |
| 118 | // ignore this. |
| 119 | var scope_size = scope.scopeObject().properties().length; |
| 120 | if (!scope.scopeObject().property('arguments').isUndefined()) { |
| 121 | scope_size--; |
| 122 | } |
| 123 | // Temporary variables introduced by the parser have not been materialized. |
| 124 | assertTrue(scope.scopeObject().property('').isUndefined()); |
| 125 | |
| 126 | if (count != scope_size) { |
| 127 | print('Names found in scope:'); |
| 128 | var names = scope.scopeObject().propertyNames(); |
| 129 | for (var i = 0; i < names.length; i++) { |
| 130 | print(names[i]); |
| 131 | } |
| 132 | } |
| 133 | assertEquals(count, scope_size); |
| 134 | } |
| 135 | |
| 136 | |
| 137 | function assertEqualsUnlessOptimized(expected, value, f) { |
no test coverage detected