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

Side by Side Diff: pkg/kernel/lib/clone.dart

Issue 2616703006: Preserve isConst when cloning. (Closed)
Patch Set: Created 3 years, 11 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 library kernel.clone; 4 library kernel.clone;
5 5
6 import 'ast.dart'; 6 import 'ast.dart';
7 import 'type_algebra.dart'; 7 import 'type_algebra.dart';
8 8
9 /// Visitor that return a clone of a tree, maintaining references to cloned 9 /// Visitor that return a clone of a tree, maintaining references to cloned
10 /// objects. 10 /// objects.
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 return new DirectMethodInvocation( 112 return new DirectMethodInvocation(
113 clone(node.receiver), node.target, clone(node.arguments)); 113 clone(node.receiver), node.target, clone(node.arguments));
114 } 114 }
115 115
116 visitSuperMethodInvocation(SuperMethodInvocation node) { 116 visitSuperMethodInvocation(SuperMethodInvocation node) {
117 return new SuperMethodInvocation( 117 return new SuperMethodInvocation(
118 node.name, clone(node.arguments), node.interfaceTarget); 118 node.name, clone(node.arguments), node.interfaceTarget);
119 } 119 }
120 120
121 visitStaticInvocation(StaticInvocation node) { 121 visitStaticInvocation(StaticInvocation node) {
122 return new StaticInvocation(node.target, clone(node.arguments)); 122 return new StaticInvocation(node.target, clone(node.arguments),
123 isConst: node.isConst);
123 } 124 }
124 125
125 visitConstructorInvocation(ConstructorInvocation node) { 126 visitConstructorInvocation(ConstructorInvocation node) {
126 return new ConstructorInvocation(node.target, clone(node.arguments)); 127 return new ConstructorInvocation(node.target, clone(node.arguments),
128 isConst: node.isConst);
127 } 129 }
128 130
129 visitNot(Not node) { 131 visitNot(Not node) {
130 return new Not(clone(node.operand)); 132 return new Not(clone(node.operand));
131 } 133 }
132 134
133 visitLogicalExpression(LogicalExpression node) { 135 visitLogicalExpression(LogicalExpression node) {
134 return new LogicalExpression( 136 return new LogicalExpression(
135 clone(node.left), node.operator, clone(node.right)); 137 clone(node.left), node.operator, clone(node.right));
136 } 138 }
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 visitArguments(Arguments node) { 394 visitArguments(Arguments node) {
393 return new Arguments(node.positional.map(clone).toList(), 395 return new Arguments(node.positional.map(clone).toList(),
394 types: node.types.map(visitType).toList(), 396 types: node.types.map(visitType).toList(),
395 named: node.named.map(clone).toList()); 397 named: node.named.map(clone).toList());
396 } 398 }
397 399
398 visitNamedExpression(NamedExpression node) { 400 visitNamedExpression(NamedExpression node) {
399 return new NamedExpression(node.name, clone(node.value)); 401 return new NamedExpression(node.name, clone(node.value));
400 } 402 }
401 } 403 }
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