Index: dart/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart |
diff --git a/dart/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart b/dart/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart |
index 016418fb4cca44f9585bfeed676ebf0ee13329f6..d691fd012c5b6c93a895352de8897982025397ab 100644 |
--- a/dart/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart |
+++ b/dart/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart |
@@ -13,14 +13,7 @@ import 'dart:_foreign_helper' show DART_CLOSURE_TO_JS, |
JS_OPERATOR_IS_PREFIX, |
JS_OPERATOR_AS_PREFIX, |
RAW_DART_FUNCTION_REF; |
-import 'dart:_interceptors' show getInterceptor, |
- interceptedNames, |
- dispatchPropertyName, |
- makeDispatchRecord, |
- setDispatchProperty, |
- Interceptor, |
- JSMutableIndexable, |
- JSUnknown; |
+import 'dart:_interceptors'; |
Johnni Winther
2013/05/27 05:38:49
Why do you remove these?
ahe
2013/05/27 06:46:04
I needed most of interceptors imported.
|
import "dart:_collection-dev" as _symbol_dev; |
part 'constant_map.dart'; |
@@ -578,6 +571,14 @@ class Primitives { |
} |
static getConstructor(String className) { |
+ // TODO(ahe): Generalize this and improve test coverage of |
+ // reflecting on intercepted classes. |
+ if (JS('bool', '# == "String"', className)) return const JSString(); |
+ if (JS('bool', '# == "int"', int)) return const JSInt(); |
+ if (JS('bool', '# == "double"', int)) return const JSDouble(); |
+ if (JS('bool', '# == "num"', int)) return const JSNumber(); |
+ if (JS('bool', '# == "bool"', int)) return const JSBool(); |
+ if (JS('bool', '# == "List"', int)) return const JSArray(); |
// TODO(ahe): How to safely access $? |
return JS('var', r'$[#]', className); |
} |