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

Side by Side Diff: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart

Issue 1325843003: Add optional message to assert in Dart2js. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Reintroduce assertHelper for asserts without messages. Created 5 years, 3 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 dart2js.ir_builder_task; 5 library dart2js.ir_builder_task;
6 6
7 import '../closure.dart' as closurelib; 7 import '../closure.dart' as closurelib;
8 import '../closure.dart' hide ClosureScope; 8 import '../closure.dart' hide ClosureScope;
9 import '../common/names.dart' show 9 import '../common/names.dart' show
10 Names, 10 Names,
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 // Throw away the result of visiting the expression. 643 // Throw away the result of visiting the expression.
644 // Instead we return the result of visiting the CascadeReceiver. 644 // Instead we return the result of visiting the CascadeReceiver.
645 visit(node.expression); 645 visit(node.expression);
646 ir.Primitive receiver = _currentCascadeReceiver; 646 ir.Primitive receiver = _currentCascadeReceiver;
647 _currentCascadeReceiver = oldCascadeReceiver; 647 _currentCascadeReceiver = oldCascadeReceiver;
648 return receiver; 648 return receiver;
649 } 649 }
650 650
651 // ## Sends ## 651 // ## Sends ##
652 @override 652 @override
653 ir.Primitive visitAssert(ast.Send node, ast.Node condition, _) {
654 assert(irBuilder.isOpen);
655 if (compiler.enableUserAssertions) {
656 return giveup(node, 'assert in checked mode not implemented');
657 } else {
658 // The call to assert and its argument expression must be ignored
659 // in production mode.
660 // Assertions can only occur in expression statements, so no value needs
661 // to be returned.
662 return null;
663 }
664 }
665
666 @override
667 void previsitDeferredAccess(ast.Send node, PrefixElement prefix, _) { 653 void previsitDeferredAccess(ast.Send node, PrefixElement prefix, _) {
668 giveup(node, 'deferred access is not implemented'); 654 giveup(node, 'deferred access is not implemented');
669 } 655 }
670 656
671 ir.Primitive visitNamedArgument(ast.NamedArgument node) { 657 ir.Primitive visitNamedArgument(ast.NamedArgument node) {
672 assert(irBuilder.isOpen); 658 assert(irBuilder.isOpen);
673 return visit(node.expression); 659 return visit(node.expression);
674 } 660 }
675 661
676 @override 662 @override
(...skipping 2893 matching lines...) Expand 10 before | Expand all | Expand 10 after
3570 if (compiler.backend.isForeign(function)) { 3556 if (compiler.backend.isForeign(function)) {
3571 return handleForeignCode(node, function, argumentList, callStructure); 3557 return handleForeignCode(node, function, argumentList, callStructure);
3572 } else { 3558 } else {
3573 return irBuilder.buildStaticFunctionInvocation(function, callStructure, 3559 return irBuilder.buildStaticFunctionInvocation(function, callStructure,
3574 translateStaticArguments(argumentList, function, callStructure), 3560 translateStaticArguments(argumentList, function, callStructure),
3575 sourceInformation: 3561 sourceInformation:
3576 sourceInformationBuilder.buildCall(node, node.selector)); 3562 sourceInformationBuilder.buildCall(node, node.selector));
3577 } 3563 }
3578 } 3564 }
3579 } 3565 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698