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

Side by Side Diff: pkg/kernel/lib/transformations/closure/converter.dart

Issue 2939043002: Remove unnecessary contexts in closure conversion (Closed)
Patch Set: Small comment edit Created 3 years, 6 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 | « no previous file | pkg/kernel/lib/transformations/closure/info.dart » ('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 (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library kernel.transformations.closure.converter; 5 library kernel.transformations.closure.converter;
6 6
7 import '../../ast.dart' 7 import '../../ast.dart'
8 show 8 show
9 Arguments, 9 Arguments,
10 Block, 10 Block,
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 407
408 currentMember = node; 408 currentMember = node;
409 409
410 if (node.isInstanceMember) { 410 if (node.isInstanceMember) {
411 Name tearOffName = tearOffGetterNames[node.name]; 411 Name tearOffName = tearOffGetterNames[node.name];
412 if (tearOffName != null) { 412 if (tearOffName != null) {
413 if (node.isGetter) { 413 if (node.isGetter) {
414 // We rename the getter to avoid an indirection in most cases. 414 // We rename the getter to avoid an indirection in most cases.
415 Name oldName = node.name; 415 Name oldName = node.name;
416 node.name = tearOffName; 416 node.name = tearOffName;
417 node.reference.canonicalName.unbind(); 417 node.canonicalName?.unbind();
418 addGetterForwarder(oldName, node); 418 addGetterForwarder(oldName, node);
419 } else if (node.kind == ProcedureKind.Method) { 419 } else if (node.kind == ProcedureKind.Method) {
420 addTearOffMethod(tearOffName, node); 420 addTearOffMethod(tearOffName, node);
421 } 421 }
422 } 422 }
423 } 423 }
424 424
425 FunctionNode function = node.function; 425 FunctionNode function = node.function;
426 if (function.body != null) { 426 if (function.body != null) {
427 setupContextForFunctionBody(function); 427 setupContextForFunctionBody(function);
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 newClassMembers.add(tearOffMethod); 876 newClassMembers.add(tearOffMethod);
877 877
878 resetContext(); 878 resetContext();
879 }); 879 });
880 } finally { 880 } finally {
881 currentMember = oldCurrentMember; 881 currentMember = oldCurrentMember;
882 currentMemberFunction = oldCurrentMemberFunction; 882 currentMemberFunction = oldCurrentMemberFunction;
883 } 883 }
884 } 884 }
885 } 885 }
OLDNEW
« no previous file with comments | « no previous file | pkg/kernel/lib/transformations/closure/info.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698