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

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

Issue 2936203002: Unbind canonical name of getter after renaming it in closure conversion (Closed)
Patch Set: Merge in recent changes in master 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 | no next file » | 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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 409
410 currentMember = node; 410 currentMember = node;
411 411
412 if (node.isInstanceMember) { 412 if (node.isInstanceMember) {
413 Name tearOffName = tearOffGetterNames[node.name]; 413 Name tearOffName = tearOffGetterNames[node.name];
414 if (tearOffName != null) { 414 if (tearOffName != null) {
415 if (node.isGetter) { 415 if (node.isGetter) {
416 // We rename the getter to avoid an indirection in most cases. 416 // We rename the getter to avoid an indirection in most cases.
417 Name oldName = node.name; 417 Name oldName = node.name;
418 node.name = tearOffName; 418 node.name = tearOffName;
419 node.reference.canonicalName.unbind();
419 addGetterForwarder(oldName, node); 420 addGetterForwarder(oldName, node);
420 } else if (node.kind == ProcedureKind.Method) { 421 } else if (node.kind == ProcedureKind.Method) {
421 addTearOffMethod(tearOffName, node); 422 addTearOffMethod(tearOffName, node);
422 } 423 }
423 } 424 }
424 } 425 }
425 426
426 FunctionNode function = node.function; 427 FunctionNode function = node.function;
427 if (function.body != null) { 428 if (function.body != null) {
428 setupContextForFunctionBody(function); 429 setupContextForFunctionBody(function);
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 newClassMembers.add(tearOffMethod); 878 newClassMembers.add(tearOffMethod);
878 879
879 resetContext(); 880 resetContext();
880 }); 881 });
881 } finally { 882 } finally {
882 currentMember = oldCurrentMember; 883 currentMember = oldCurrentMember;
883 currentMemberFunction = oldCurrentMemberFunction; 884 currentMemberFunction = oldCurrentMemberFunction;
884 } 885 }
885 } 886 }
886 } 887 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698