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

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

Issue 130563004: Redo "Make dart2js typed_data implementation classes private" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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..cae6a3e76fcdf787b3221f7d9366ddaaef981a00 100644
--- a/sdk/lib/_internal/compiler/implementation/elements/elements.dart
+++ b/sdk/lib/_internal/compiler/implementation/elements/elements.dart
@@ -566,12 +566,17 @@ 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();
+ //if (cls == null) return false;
floitsch 2014/01/15 09:33:30 Remove?
sra1 2014/01/15 20:13:41 Done.
+ 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