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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/resolver/ElementResolverTest.java

Issue 14622019: Report CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Check for all 'super' expressions. Don't resolve methods/accessors if invalid. Created 7 years, 7 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: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/resolver/ElementResolverTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/resolver/ElementResolverTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/resolver/ElementResolverTest.java
index 5a511a9b518fc8800250c536cbaa21c38b20fd6d..4bff317bfd9aef0a3d12c80e00ef104b31dd1a65 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/resolver/ElementResolverTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/resolver/ElementResolverTest.java
@@ -75,13 +75,16 @@ import static com.google.dart.engine.ast.ASTFactory.breakStatement;
import static com.google.dart.engine.ast.ASTFactory.constructorName;
import static com.google.dart.engine.ast.ASTFactory.continueStatement;
import static com.google.dart.engine.ast.ASTFactory.exportDirective;
+import static com.google.dart.engine.ast.ASTFactory.expressionFunctionBody;
import static com.google.dart.engine.ast.ASTFactory.fieldFormalParameter;
+import static com.google.dart.engine.ast.ASTFactory.formalParameterList;
import static com.google.dart.engine.ast.ASTFactory.hideCombinator;
import static com.google.dart.engine.ast.ASTFactory.identifier;
import static com.google.dart.engine.ast.ASTFactory.importDirective;
import static com.google.dart.engine.ast.ASTFactory.indexExpression;
import static com.google.dart.engine.ast.ASTFactory.instanceCreationExpression;
import static com.google.dart.engine.ast.ASTFactory.integer;
+import static com.google.dart.engine.ast.ASTFactory.methodDeclaration;
import static com.google.dart.engine.ast.ASTFactory.methodInvocation;
import static com.google.dart.engine.ast.ASTFactory.namedExpression;
import static com.google.dart.engine.ast.ASTFactory.postfixExpression;
@@ -484,6 +487,14 @@ public class ElementResolverTest extends EngineTestCase {
SuperExpression target = superExpression();
target.setStaticType(classA.getType());
PropertyAccess access = propertyAccess(target, getterName);
+ methodDeclaration(
+ null,
+ null,
+ null,
+ null,
+ identifier("m"),
+ formalParameterList(),
+ expressionFunctionBody(access));
resolveNode(access);
assertSame(getter, access.getPropertyName().getElement());
listener.assertNoErrors();

Powered by Google App Engine
This is Rietveld 408576698