| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 } | 137 } |
| 138 count++; | 138 count++; |
| 139 } | 139 } |
| 140 | 140 |
| 141 // 'arguments' and might be exposed in the local and closure scope. Just | 141 // 'arguments' and might be exposed in the local and closure scope. Just |
| 142 // ignore this. | 142 // ignore this. |
| 143 var scope_size = scope.scopeObject().properties().length; | 143 var scope_size = scope.scopeObject().properties().length; |
| 144 if (!scope.scopeObject().property('arguments').isUndefined()) { | 144 if (!scope.scopeObject().property('arguments').isUndefined()) { |
| 145 scope_size--; | 145 scope_size--; |
| 146 } | 146 } |
| 147 // Also ignore synthetic variable from catch block. | |
| 148 if (!scope.scopeObject().property('.catch-var').isUndefined()) { | |
| 149 scope_size--; | |
| 150 } | |
| 151 // Skip property with empty name. | 147 // Skip property with empty name. |
| 152 if (!scope.scopeObject().property('').isUndefined()) { | 148 if (!scope.scopeObject().property('').isUndefined()) { |
| 153 scope_size--; | 149 scope_size--; |
| 154 } | 150 } |
| 155 // Also ignore synthetic variable from block scopes. | |
| 156 if (!scope.scopeObject().property('.block').isUndefined()) { | |
| 157 scope_size--; | |
| 158 } | |
| 159 | 151 |
| 160 if (count != scope_size) { | 152 if (count != scope_size) { |
| 161 print('Names found in scope:'); | 153 print('Names found in scope:'); |
| 162 var names = scope.scopeObject().propertyNames(); | 154 var names = scope.scopeObject().propertyNames(); |
| 163 for (var i = 0; i < names.length; i++) { | 155 for (var i = 0; i < names.length; i++) { |
| 164 print(names[i]); | 156 print(names[i]); |
| 165 } | 157 } |
| 166 } | 158 } |
| 167 assertEquals(count, scope_size); | 159 assertEquals(count, scope_size); |
| 168 | 160 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 CheckScopeChain([debug.ScopeType.Local, | 207 CheckScopeChain([debug.ScopeType.Local, |
| 216 debug.ScopeType.Block, | 208 debug.ScopeType.Block, |
| 217 debug.ScopeType.Closure, | 209 debug.ScopeType.Closure, |
| 218 debug.ScopeType.Global], exec_state); | 210 debug.ScopeType.Global], exec_state); |
| 219 CheckScopeContent({}, 0, exec_state); | 211 CheckScopeContent({}, 0, exec_state); |
| 220 CheckScopeContent({z:4}, 1, exec_state); | 212 CheckScopeContent({z:4}, 1, exec_state); |
| 221 CheckScopeContent({a:1,x:2,y:3}, 2, exec_state); | 213 CheckScopeContent({a:1,x:2,y:3}, 2, exec_state); |
| 222 }; | 214 }; |
| 223 closure_1(1)(); | 215 closure_1(1)(); |
| 224 EndTest(); | 216 EndTest(); |
| OLD | NEW |