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

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
Index: lib/compiler/implementation/resolver.dart
===================================================================
--- lib/compiler/implementation/resolver.dart (revision 8394)
+++ lib/compiler/implementation/resolver.dart (working copy)
@@ -1052,6 +1052,11 @@
AbstractFieldElement field = target;
target = field.getter;
}
+ if (target == compiler.assertMethod && !node.isCall) {
kasperl 2012/06/08 05:34:05 ===
ngeoffray 2012/06/08 09:40:58 Done.
+ // We can only use assert by calling it.
+ if (!inInstanceContext) error(node, MessageKind.CANNOT_RESOLVE, [node]);
ahe 2012/06/08 07:59:14 I'm not sure about this error message. I think it
ngeoffray 2012/06/08 09:40:58 Done.
+ target = null;
+ }
// TODO(ngeoffray): Warn if target is null and the send is
// unqualified.
useElement(node, target);

Powered by Google App Engine
This is Rietveld 408576698