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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
66 } | 66 } |
67 return F2(17); | 67 return F2(17); |
68 })(5); | 68 })(5); |
69 | 69 |
70 var mirror = Debug.MakeMirror(f1); | 70 var mirror = Debug.MakeMirror(f1); |
71 | 71 |
72 assertEquals(6, mirror.scopeCount()); | 72 assertEquals(6, mirror.scopeCount()); |
73 | 73 |
74 CheckScope(mirror.scope(0), { a: 4, b: 5 }, ScopeType.Closure); | 74 CheckScope(mirror.scope(0), { a: 4, b: 5 }, ScopeType.Closure); |
75 CheckScope(mirror.scope(1), { w: 5, v: "Capybara" }, ScopeType.With); | 75 CheckScope(mirror.scope(1), { w: 5, v: "Capybara" }, ScopeType.With); |
76 CheckScope(mirror.scope(2), { y: 17, z: 22 }, ScopeType.Closure); | 76 CheckScope(mirror.scope(2), { z: 22 }, ScopeType.Closure); |
adamk
2016/03/14 22:22:11
'y' is now in the same state as 'p', as it's not r
| |
77 CheckScope(mirror.scope(3), { x: 5 }, ScopeType.Closure); | 77 CheckScope(mirror.scope(3), { x: 5 }, ScopeType.Closure); |
78 CheckScope(mirror.scope(4), {}, ScopeType.Script); | 78 CheckScope(mirror.scope(4), {}, ScopeType.Script); |
79 CheckScope(mirror.scope(5), {}, ScopeType.Global); | 79 CheckScope(mirror.scope(5), {}, ScopeType.Global); |
80 | 80 |
81 var f2 = function() { return 5; } | 81 var f2 = function() { return 5; } |
82 | 82 |
83 var mirror = Debug.MakeMirror(f2); | 83 var mirror = Debug.MakeMirror(f2); |
84 | 84 |
85 assertEquals(2, mirror.scopeCount()); | 85 assertEquals(2, mirror.scopeCount()); |
86 | 86 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
158 var mirror = Debug.MakeMirror(f); | 158 var mirror = Debug.MakeMirror(f); |
159 assertEquals(0, mirror.scopeCount()); | 159 assertEquals(0, mirror.scopeCount()); |
160 } | 160 } |
161 | 161 |
162 CheckNoScopeVisible(Number); | 162 CheckNoScopeVisible(Number); |
163 | 163 |
164 CheckNoScopeVisible(Function.toString); | 164 CheckNoScopeVisible(Function.toString); |
165 | 165 |
166 // This getter is known to be implemented as closure. | 166 // This getter is known to be implemented as closure. |
167 CheckNoScopeVisible(new Error().__lookupGetter__("stack")); | 167 CheckNoScopeVisible(new Error().__lookupGetter__("stack")); |
OLD | NEW |