| 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 8d1f3013035ed67bb9683086263fe286aa45f756..6332b1f12f6ef3eb5192ece8bbcce1b0a94db168 100644
|
| --- a/lib/compiler/implementation/lib/js_helper.dart
|
| +++ b/lib/compiler/implementation/lib/js_helper.dart
|
| @@ -1289,3 +1289,23 @@ 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('Object', @'$.runtimeTypeCache[#]', key);
|
| + if (runtimeType == null) {
|
| + runtimeType = new TypeImpl(key);
|
| + JS('void', @'$.runtimeTypeCache[#] = #', key, runtimeType);
|
| + }
|
| + return runtimeType;
|
| +}
|
| +
|
| +String getRuntimeTypeString(var object) {
|
| + var typeInfo = JS('Object', @'#.builtin$typeInfo', object);
|
| + return JS('String', @'#.runtimeType', typeInfo);
|
| +}
|
|
|