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

Unified Diff: lib/compiler/implementation/resolver.dart

Issue 10540052: Only generate assert in checked mode. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/compiler/implementation/lib/mock.dart ('k') | lib/compiler/implementation/ssa/builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/resolver.dart
===================================================================
--- lib/compiler/implementation/resolver.dart (revision 8424)
+++ lib/compiler/implementation/resolver.dart (working copy)
@@ -1052,6 +1052,15 @@
AbstractFieldElement field = target;
target = field.getter;
}
+ // TODO(ngeoffray): We should do the check in
+ // visitExpressionStatement instead.
+ if (target === compiler.assertMethod && !node.isCall) {
+ // We can only use assert by calling it.
+ if (!inInstanceContext) {
+ error(node, MessageKind.MISSING_ARGUMENTS_TO_ASSERT, [node]);
+ }
+ target = null;
+ }
// TODO(ngeoffray): Warn if target is null and the send is
// unqualified.
useElement(node, target);
« no previous file with comments | « lib/compiler/implementation/lib/mock.dart ('k') | lib/compiler/implementation/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698