| Index: lib/compiler/implementation/lib/js_helper.dart
|
| diff --git a/lib/compiler/implementation/lib/js_helper.dart b/lib/compiler/implementation/lib/js_helper.dart
|
| index e03c863bab5200f3b6476b4458b39775c83c6337..6851e3ddbbd33d4f506d7940ce4fa1b78901dc59 100644
|
| --- a/lib/compiler/implementation/lib/js_helper.dart
|
| +++ b/lib/compiler/implementation/lib/js_helper.dart
|
| @@ -1324,3 +1324,25 @@ void throwNoSuchMethod(obj, name, arguments) {
|
| void throwCyclicInit(String staticName) {
|
| throw new RuntimeError("Cyclic initialization for static $staticName");
|
| }
|
| +
|
| +class TypeImpl implements Type {
|
| + final String typeName;
|
| + TypeImpl(this.typeName);
|
| + toString() => typeName;
|
| +}
|
| +
|
| +Type getOrCreateCachedRuntimeType(String key) {
|
| + Type runtimeType =
|
| + JS('Type', @'#.runtimeTypeCache[#]', JS_CURRENT_ISOLATE(), key);
|
| + if (runtimeType == null) {
|
| + runtimeType = new TypeImpl(key);
|
| + JS('void', @'#.runtimeTypeCache[#] = #', JS_CURRENT_ISOLATE(), key,
|
| + runtimeType);
|
| + }
|
| + return runtimeType;
|
| +}
|
| +
|
| +String getRuntimeTypeString(var object) {
|
| + var typeInfo = JS('Object', @'#.builtin$typeInfo', object);
|
| + return JS('String', @'#.runtimeType', typeInfo);
|
| +}
|
|
|