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

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

Issue 883823002: Implement proper scoping for "this" in arrow functions Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased against master, plus fixes. Only 4 tests failing (+2 in TurboFan) Created 5 years, 10 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 | « src/x64/lithium-codegen-x64.cc ('k') | test/mjsunit/harmony/arrow-functions-scoping.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 } 160 }
161 count++; 161 count++;
162 } 162 }
163 163
164 // 'arguments' and might be exposed in the local and closure scope. Just 164 // 'arguments' and might be exposed in the local and closure scope. Just
165 // ignore this. 165 // ignore this.
166 var scope_size = scope.scopeObject().properties().length; 166 var scope_size = scope.scopeObject().properties().length;
167 if (!scope.scopeObject().property('arguments').isUndefined()) { 167 if (!scope.scopeObject().property('arguments').isUndefined()) {
168 scope_size--; 168 scope_size--;
169 } 169 }
170 // Ditto for 'this'.
171 if (!scope.scopeObject().property('this').isUndefined()) {
172 scope_size--;
173 }
170 // Skip property with empty name. 174 // Skip property with empty name.
171 if (!scope.scopeObject().property('').isUndefined()) { 175 if (!scope.scopeObject().property('').isUndefined()) {
172 scope_size--; 176 scope_size--;
173 } 177 }
174 178
175 if (count != scope_size) { 179 if (count != scope_size) {
176 print('Names found in scope:'); 180 print('Names found in scope:');
177 var names = scope.scopeObject().propertyNames(); 181 var names = scope.scopeObject().propertyNames();
178 for (var i = 0; i < names.length; i++) { 182 for (var i = 0; i < names.length; i++) {
179 print(names[i]); 183 print(names[i]);
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after
1046 CheckScopeContent({e:'Exception'}, 0, exec_state); 1050 CheckScopeContent({e:'Exception'}, 0, exec_state);
1047 }; 1051 };
1048 catch_block_7(); 1052 catch_block_7();
1049 EndTest(); 1053 EndTest();
1050 1054
1051 1055
1052 assertEquals(begin_test_count, break_count, 1056 assertEquals(begin_test_count, break_count,
1053 'one or more tests did not enter the debugger'); 1057 'one or more tests did not enter the debugger');
1054 assertEquals(begin_test_count, end_test_count, 1058 assertEquals(begin_test_count, end_test_count,
1055 'one or more tests did not have its result checked'); 1059 'one or more tests did not have its result checked');
OLDNEW
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | test/mjsunit/harmony/arrow-functions-scoping.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698