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

Unified Diff: lib/compiler/implementation/dart_backend/placeholder_collector.dart

Issue 10920089: Generate a warning and a runtime error for calls to nonexistent static calls, getters and setters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove case for variable == null in handling of ForIn. 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/dart_backend/placeholder_collector.dart
diff --git a/lib/compiler/implementation/dart_backend/placeholder_collector.dart b/lib/compiler/implementation/dart_backend/placeholder_collector.dart
index 39130b0952d8e7c7ca934da43b795ed581e4ed3c..8b636b47af61ffd4cd3cb7bcc04295e27d774ddb 100644
--- a/lib/compiler/implementation/dart_backend/placeholder_collector.dart
+++ b/lib/compiler/implementation/dart_backend/placeholder_collector.dart
@@ -59,6 +59,8 @@ class SendVisitor extends ResolvedVisitor {
// element === null means dynamic property access.
if (element === null) {
collector.tryMakeMemberPlaceholder(node.selector);
+ } else if (element.isErroneous()) {
+ return;
} else if (element.isPrefix()) {
// Node is prefix part in case of source 'lib.somesetter = 5;'
collector.makeNullPlaceholder(node);
@@ -82,6 +84,9 @@ class SendVisitor extends ResolvedVisitor {
visitStaticSend(Send node) {
final element = elements[node];
+ if (Element.isInvalid(element)) {
+ return;
+ }
if (element.isConstructor() || element.isFactoryConstructor()) {
// Rename named constructor in redirection position:
// class C { C.named(); C.redirecting() : this.named(); }
@@ -362,7 +367,7 @@ class PlaceholderCollector extends AbstractVisitor {
visitSendSet(SendSet send) {
final element = treeElements[send];
- if (element !== null) {
+ if (!Element.isInvalid(element)) {
if (Elements.isStaticOrTopLevel(element)) {
assert(element is VariableElement || element.isSetter());
makeElementPlaceholder(send.selector, element);
« no previous file with comments | « no previous file | lib/compiler/implementation/elements/elements.dart » ('j') | lib/compiler/implementation/elements/elements.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698