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

Unified Diff: sdk/lib/_internal/compiler/implementation/elements/modelx.dart

Issue 232563006: Insert checks before deferred calls and accesses. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Correct update to co19 Created 6 years, 8 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: sdk/lib/_internal/compiler/implementation/elements/modelx.dart
diff --git a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
index 87828ea0989020930d9fa18c86a63e945ffb918d..8b076166c827fc1137cd87de131d925cab9a5052 100644
--- a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
+++ b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
@@ -331,6 +331,8 @@ class ErroneousElementX extends ElementX implements ErroneousElement {
isErroneous() => true;
+ AbstractFieldElement abstractField;
+
unsupported() {
throw 'unsupported operation on erroneous element';
}
@@ -540,7 +542,7 @@ class ScopeX {
* element, they are enclosed by the class or compilation unit, as is the
* abstract field.
*/
- void addAccessor(Element accessor,
+ void addAccessor(FunctionElementX accessor,
Element existing,
DiagnosticListener listener) {
void reportError(Element other) {
@@ -558,6 +560,7 @@ class ScopeX {
reportError(existing);
} else {
AbstractFieldElementX field = existing;
+ accessor.abstractField = field;
if (accessor.isGetter()) {
if (field.getter != null && field.getter != accessor) {
reportError(field.getter);
@@ -575,6 +578,7 @@ class ScopeX {
Element container = accessor.getEnclosingClassOrCompilationUnit();
AbstractFieldElementX field =
new AbstractFieldElementX(accessor.name, container);
+ accessor.abstractField = field;
if (accessor.isGetter()) {
field.getter = accessor;
} else {
@@ -1499,6 +1503,8 @@ class FunctionElementX extends ElementX with AnalyzableElement
final bool _hasNoBody;
+ AbstractFieldElement abstractField;
+
/**
* If this is a redirecting factory, [defaultImplementation] will be
* changed by the resolver to point to the redirection target.

Powered by Google App Engine
This is Rietveld 408576698