Chromium Code Reviews| 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); |