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

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

Issue 11014010: Made assert a keyword. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
Index: lib/compiler/implementation/resolver.dart
diff --git a/lib/compiler/implementation/resolver.dart b/lib/compiler/implementation/resolver.dart
index ef8c2274e9123266caef50952b78fc5b8ae411e7..3a0519ab4dbedc4b9e4b87c31c0db9dd93db93c6 100644
--- a/lib/compiler/implementation/resolver.dart
+++ b/lib/compiler/implementation/resolver.dart
@@ -1267,17 +1267,6 @@ class ResolverVisitor extends CommonResolverVisitor<Element> {
return (str === '&&' || str == '||' || str == '!');
}
- /**
- * Check the lexical scope chain for a declaration with the name "assert".
- *
- * This is used to detect whether "assert(x)" is actually an assertion or
- * just a call expression.
- * It does not check fields inherited from a superclass.
- */
- bool isAssertInLexicalScope() {
- return scope.lexicalLookup(const SourceString("assert")) !== null;
- }
-
/** Check if [node] is the expression of the current expression statement. */
bool isExpressionStatementExpression(Node node) {
return currentExpressionStatement !== null &&
@@ -1292,8 +1281,7 @@ class ResolverVisitor extends CommonResolverVisitor<Element> {
// the form "assert(expr);", and there is no declaration with name
// "assert" in the lexical scope, then this is actually an assertion.
if (isExpressionStatementExpression(node) &&
ahe 2012/10/10 08:44:13 I don't think this check is needed. This must be t
- selector.isAssertSyntax() &&
- !isAssertInLexicalScope()) {
+ selector.isAssertSyntax()) {
return compiler.assertMethod;
}
return node.selector.accept(this);

Powered by Google App Engine
This is Rietveld 408576698