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

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

Issue 2940283002: [kernel] Fix assert message. (Closed)
Patch Set: 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
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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 visitBlock(Block node) { 263 visitBlock(Block node) {
264 return new Block(node.statements.map(clone).toList()); 264 return new Block(node.statements.map(clone).toList());
265 } 265 }
266 266
267 visitEmptyStatement(EmptyStatement node) { 267 visitEmptyStatement(EmptyStatement node) {
268 return new EmptyStatement(); 268 return new EmptyStatement();
269 } 269 }
270 270
271 visitAssertStatement(AssertStatement node) { 271 visitAssertStatement(AssertStatement node) {
272 return new AssertStatement( 272 return new AssertStatement(
273 clone(node.condition), cloneOptional(node.message)); 273 clone(node.condition), cloneOptional(node.message))
274 ..conditionStartOffset = node.conditionStartOffset
275 ..conditionEndOffset = node.conditionEndOffset;
274 } 276 }
275 277
276 visitLabeledStatement(LabeledStatement node) { 278 visitLabeledStatement(LabeledStatement node) {
277 LabeledStatement newNode = new LabeledStatement(null); 279 LabeledStatement newNode = new LabeledStatement(null);
278 labels[node] = newNode; 280 labels[node] = newNode;
279 newNode.body = clone(node.body)..parent = newNode; 281 newNode.body = clone(node.body)..parent = newNode;
280 return newNode; 282 return newNode;
281 } 283 }
282 284
283 visitBreakStatement(BreakStatement node) { 285 visitBreakStatement(BreakStatement node) {
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 visitArguments(Arguments node) { 431 visitArguments(Arguments node) {
430 return new Arguments(node.positional.map(clone).toList(), 432 return new Arguments(node.positional.map(clone).toList(),
431 types: node.types.map(visitType).toList(), 433 types: node.types.map(visitType).toList(),
432 named: node.named.map(clone).toList()); 434 named: node.named.map(clone).toList());
433 } 435 }
434 436
435 visitNamedExpression(NamedExpression node) { 437 visitNamedExpression(NamedExpression node) {
436 return new NamedExpression(node.name, clone(node.value)); 438 return new NamedExpression(node.name, clone(node.value));
437 } 439 }
438 } 440 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698