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

Side by Side Diff: pkg/compiler/lib/src/kernel/kernel_visitor.dart

Issue 2650853012: Add default value to isBreakTarget optional parameter. (Closed)
Patch Set: Created 3 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 | « 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.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 import 'package:kernel/ast.dart' as ir; 5 import 'package:kernel/ast.dart' as ir;
6 import 'package:kernel/frontend/accessors.dart' 6 import 'package:kernel/frontend/accessors.dart'
7 show 7 show
8 Accessor, 8 Accessor,
9 IndexAccessor, 9 IndexAccessor,
10 NullAwarePropertyAccessor, 10 NullAwarePropertyAccessor,
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 398
399 ir.SwitchCase getContinueSwitchTarget(JumpTarget target) { 399 ir.SwitchCase getContinueSwitchTarget(JumpTarget target) {
400 return continueSwitchTargets[target]; 400 return continueSwitchTargets[target];
401 } 401 }
402 402
403 /// The optional positional parameter isBreakTarget can be added in cases 403 /// The optional positional parameter isBreakTarget can be added in cases
404 /// where a break statement was added but the element model and underlying 404 /// where a break statement was added but the element model and underlying
405 /// JumpTargets don't know about it. 405 /// JumpTargets don't know about it.
406 ir.Statement buildBreakTarget( 406 ir.Statement buildBreakTarget(
407 ir.Statement statement, Node node, JumpTarget jumpTarget, 407 ir.Statement statement, Node node, JumpTarget jumpTarget,
408 [bool isBreakTarget]) { 408 [bool isBreakTarget = false]) {
409 assert(node.isValidBreakTarget()); 409 assert(node.isValidBreakTarget());
410 assert(jumpTarget == elements.getTargetDefinition(node)); 410 assert(jumpTarget == elements.getTargetDefinition(node));
411 associateNode(statement, node); 411 associateNode(statement, node);
412 if (jumpTarget != null && (jumpTarget.isBreakTarget || isBreakTarget)) { 412 if (jumpTarget != null && (jumpTarget.isBreakTarget || isBreakTarget)) {
413 ir.LabeledStatement breakTarget = getBreakTarget(jumpTarget); 413 ir.LabeledStatement breakTarget = getBreakTarget(jumpTarget);
414 breakTarget.body = statement; 414 breakTarget.body = statement;
415 statement.parent = breakTarget; 415 statement.parent = breakTarget;
416 return breakTarget; 416 return breakTarget;
417 } else { 417 } else {
418 return statement; 418 return statement;
(...skipping 2447 matching lines...) Expand 10 before | Expand all | Expand 10 after
2866 : this(null, true, node, initializers); 2866 : this(null, true, node, initializers);
2867 2867
2868 accept(ir.Visitor v) => throw "unsupported"; 2868 accept(ir.Visitor v) => throw "unsupported";
2869 2869
2870 visitChildren(ir.Visitor v) => throw "unsupported"; 2870 visitChildren(ir.Visitor v) => throw "unsupported";
2871 2871
2872 String toString() { 2872 String toString() {
2873 return "IrFunction($kind, $isConstructor, $node, $initializers)"; 2873 return "IrFunction($kind, $isConstructor, $node, $initializers)";
2874 } 2874 }
2875 } 2875 }
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