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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 CheckScope(mirror.scope(0), {}, ScopeType.Script); | 80 CheckScope(mirror.scope(0), {}, ScopeType.Script); |
81 CheckScope(mirror.scope(1), {}, ScopeType.Global); | 81 CheckScope(mirror.scope(1), {}, ScopeType.Global); |
82 | 82 |
83 var f3 = (function F1(invisible_parameter) { | 83 var f3 = (function F1(invisible_parameter) { |
84 var invisible1 = 1; | 84 var invisible1 = 1; |
85 var visible1 = 10; | 85 var visible1 = 10; |
86 return (function F2() { | 86 return (function F2() { |
87 var invisible2 = 2; | 87 var invisible2 = 2; |
88 return (function F3() { | 88 return (function F3() { |
89 var visible2 = 20; | 89 var visible2 = 20; |
| 90 var invisible2 = 3; |
90 return (function () {return visible1 + visible2 + visible1a;}); | 91 return (function () {return visible1 + visible2 + visible1a;}); |
91 })(); | 92 })(); |
92 })(); | 93 })(); |
93 })(5); | 94 })(5); |
94 | 95 |
95 var mirror = Debug.MakeMirror(f3); | 96 var mirror = Debug.MakeMirror(f3); |
96 | 97 |
97 assertEquals(4, mirror.scopeCount()); | 98 assertEquals(4, mirror.scopeCount()); |
98 | 99 |
99 CheckScope(mirror.scope(0), { visible2: 20 }, ScopeType.Closure); | 100 CheckScope(mirror.scope(0), { visible2: 20 }, ScopeType.Closure); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 148 |
148 | 149 |
149 function CheckNoScopeVisible(f) { | 150 function CheckNoScopeVisible(f) { |
150 var mirror = Debug.MakeMirror(f); | 151 var mirror = Debug.MakeMirror(f); |
151 assertEquals(0, mirror.scopeCount()); | 152 assertEquals(0, mirror.scopeCount()); |
152 } | 153 } |
153 | 154 |
154 CheckNoScopeVisible(Number); | 155 CheckNoScopeVisible(Number); |
155 | 156 |
156 CheckNoScopeVisible(Function.toString); | 157 CheckNoScopeVisible(Function.toString); |
OLD | NEW |