| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 for (var name in scope_expectations) { | 38 for (var name in scope_expectations) { |
| 39 var actual = scope_object[name]; | 39 var actual = scope_object[name]; |
| 40 var expected = scope_expectations[name]; | 40 var expected = scope_expectations[name]; |
| 41 assertEquals(expected, actual); | 41 assertEquals(expected, actual); |
| 42 } | 42 } |
| 43 } | 43 } |
| 44 | 44 |
| 45 // A copy of the scope types from mirror-debugger.js. | 45 // A copy of the scope types from mirror-debugger.js. |
| 46 var ScopeType = { Global: 0, | 46 var ScopeType = { Global: 0, |
| 47 Local: 1, | 47 GlobalLexical: 1, |
| 48 With: 2, | 48 Local: 2, |
| 49 Closure: 3, | 49 With: 3, |
| 50 Catch: 4, | 50 Closure: 4, |
| 51 Block: 5 }; | 51 Catch: 5, |
| 52 Block: 6 }; |
| 52 | 53 |
| 53 var f1 = (function F1(x) { | 54 var f1 = (function F1(x) { |
| 54 function F2(y) { | 55 function F2(y) { |
| 55 var z = x + y; | 56 var z = x + y; |
| 56 with ({w: 5, v: "Capybara"}) { | 57 with ({w: 5, v: "Capybara"}) { |
| 57 var F3 = function(a, b) { | 58 var F3 = function(a, b) { |
| 58 function F4(p) { | 59 function F4(p) { |
| 59 return p + a + b + z + w + v.length; | 60 return p + a + b + z + w + v.length; |
| 60 } | 61 } |
| 61 return F4; | 62 return F4; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 var mirror = Debug.MakeMirror(f); | 153 var mirror = Debug.MakeMirror(f); |
| 153 assertEquals(0, mirror.scopeCount()); | 154 assertEquals(0, mirror.scopeCount()); |
| 154 } | 155 } |
| 155 | 156 |
| 156 CheckNoScopeVisible(Number); | 157 CheckNoScopeVisible(Number); |
| 157 | 158 |
| 158 CheckNoScopeVisible(Function.toString); | 159 CheckNoScopeVisible(Function.toString); |
| 159 | 160 |
| 160 // This getter is known to be implemented as closure. | 161 // This getter is known to be implemented as closure. |
| 161 CheckNoScopeVisible(new Error().__lookupGetter__("stack")); | 162 CheckNoScopeVisible(new Error().__lookupGetter__("stack")); |
| OLD | NEW |