Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: test/mjsunit/debug-function-scopes.js

Issue 2352593002: Preparse inner functions (new try) (Closed)
Patch Set: add comment Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/cctest/test-parsing.cc ('k') | test/mjsunit/debug-scopes.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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;
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
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);
OLDNEW
« no previous file with comments | « test/cctest/test-parsing.cc ('k') | test/mjsunit/debug-scopes.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698