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

Unified Diff: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart

Issue 1087483003: cps-ir: Don't bail on assert in unchecked mode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Comment Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/compiler/dart2js/js_backend_cps_ir_basic_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
index 8909912d34273ae6d77a54eb5a07a31ac550c6c8..946cdb55d82f09bdc4ebbaee426677fffabc4715 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
@@ -636,12 +636,17 @@ abstract class IrBuilderVisitor extends ast.Visitor<ir.Primitive>
// ## Sends ##
@override
- ir.Primitive visitAssert(
- ast.Send node,
- ast.Node condition,
- _) {
+ ir.Primitive visitAssert(ast.Send node, ast.Node condition, _) {
assert(irBuilder.isOpen);
- return giveup(node, 'Assert');
+ if (compiler.enableUserAssertions) {
+ return giveup(node, 'assert in checked mode not implemented');
+ } else {
+ // The call to assert and its argument expression must be ignored
+ // in production mode.
+ // Assertions can only occur in expression statements, so no value needs
+ // to be returned.
+ return null;
+ }
}
ir.Primitive visitNamedArgument(ast.NamedArgument node) {
« no previous file with comments | « no previous file | tests/compiler/dart2js/js_backend_cps_ir_basic_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698