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

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

Issue 141653003: Redo "Make dart2js typed_data implementation classes private" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: suppress analysis errors of dart2js library Created 6 years, 11 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/elements.dart
diff --git a/sdk/lib/_internal/compiler/implementation/elements/elements.dart b/sdk/lib/_internal/compiler/implementation/elements/elements.dart
index 5b80da634868dc808171ade6d20f64ef0af18501..b714528f03ab4c9e50a62be750935f0634a2cac9 100644
--- a/sdk/lib/_internal/compiler/implementation/elements/elements.dart
+++ b/sdk/lib/_internal/compiler/implementation/elements/elements.dart
@@ -566,12 +566,16 @@ class Elements {
static bool isConstructorOfTypedArraySubclass(Element element,
Compiler compiler) {
- if (compiler.typedDataClass == null) return false;
- ClassElement cls = element.getEnclosingClass();
- if (cls == null || !element.isConstructor()) return false;
- return compiler.world.isSubclass(compiler.typedDataClass, cls)
- && cls.getLibrary() == compiler.typedDataLibrary
- && element.name == '';
+ if (compiler.typedDataLibrary == null) return false;
+ if (!element.isConstructor()) return false;
+ FunctionElement constructor = element;
+ constructor = constructor.redirectionTarget;
+ ClassElement cls = constructor.getEnclosingClass();
+ return cls.getLibrary() == compiler.typedDataLibrary
+ && cls.isNative()
+ && compiler.world.isSubtype(compiler.typedDataClass, cls)
+ && compiler.world.isSubtype(compiler.listClass, cls)
+ && constructor.name == '';
}
static bool switchStatementHasContinue(SwitchStatement node,

Powered by Google App Engine
This is Rietveld 408576698