| Index: sdk/lib/_internal/compiler/implementation/ssa/types.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/ssa/types.dart b/sdk/lib/_internal/compiler/implementation/ssa/types.dart
|
| index 0cc63f9f9a1038b4f4a0497c991731cc7a4a3129..e6a90448d03f18e4d4a77746e5f89787ce3062fa 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/ssa/types.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/ssa/types.dart
|
| @@ -181,7 +181,6 @@ abstract class HType {
|
| bool isInteger() => false;
|
| bool isDouble() => false;
|
| bool isString() => false;
|
| - bool isIndexablePrimitive() => false;
|
| bool isFixedArray() => false;
|
| bool isReadableArray() => false;
|
| bool isMutableArray() => false;
|
| @@ -195,6 +194,20 @@ abstract class HType {
|
| bool isStringOrNull() => false;
|
| bool isPrimitiveOrNull() => false;
|
|
|
| + // TODO(kasperl): Get rid of this one.
|
| + bool isIndexablePrimitive() => false;
|
| +
|
| + bool isIndexable(Compiler compiler) =>
|
| + implementsInterface(compiler.backend.jsIndexableClass, compiler);
|
| + bool isMutableIndexable(Compiler compiler) =>
|
| + implementsInterface(compiler.backend.jsMutableIndexableClass, compiler);
|
| +
|
| + bool implementsInterface(ClassElement interfaceElement, Compiler compiler) {
|
| + DartType interfaceType = interfaceElement.computeType(compiler);
|
| + TypeMask mask = new TypeMask.subtype(interfaceType);
|
| + return mask == mask.union(computeMask(compiler), compiler);
|
| + }
|
| +
|
| bool canBeNull() => false;
|
| bool canBePrimitive(Compiler compiler) => false;
|
| bool canBePrimitiveNumber(Compiler compiler) => false;
|
|
|