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; | |
adamk
2016/09/23 18:21:30
I take it this now becomes visible?
| |
91 return (function () {return visible1 + visible2 + visible1a;}); | 90 return (function () {return visible1 + visible2 + visible1a;}); |
92 })(); | 91 })(); |
93 })(); | 92 })(); |
94 })(5); | 93 })(5); |
95 | 94 |
96 var mirror = Debug.MakeMirror(f3); | 95 var mirror = Debug.MakeMirror(f3); |
97 | 96 |
98 assertEquals(4, mirror.scopeCount()); | 97 assertEquals(4, mirror.scopeCount()); |
99 | 98 |
100 CheckScope(mirror.scope(0), { visible2: 20 }, ScopeType.Closure); | 99 CheckScope(mirror.scope(0), { visible2: 20 }, ScopeType.Closure); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
148 | 147 |
149 | 148 |
150 function CheckNoScopeVisible(f) { | 149 function CheckNoScopeVisible(f) { |
151 var mirror = Debug.MakeMirror(f); | 150 var mirror = Debug.MakeMirror(f); |
152 assertEquals(0, mirror.scopeCount()); | 151 assertEquals(0, mirror.scopeCount()); |
153 } | 152 } |
154 | 153 |
155 CheckNoScopeVisible(Number); | 154 CheckNoScopeVisible(Number); |
156 | 155 |
157 CheckNoScopeVisible(Function.toString); | 156 CheckNoScopeVisible(Function.toString); |
OLD | NEW |