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

Unified Diff: dart/sdk/lib/_internal/lib/js_helper.dart

Issue 17024005: Revert "Correctly reflect on intercepted classes." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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
« no previous file with comments | « no previous file | dart/tests/lib/lib.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/sdk/lib/_internal/lib/js_helper.dart
diff --git a/dart/sdk/lib/_internal/lib/js_helper.dart b/dart/sdk/lib/_internal/lib/js_helper.dart
index 35c7a873102eb7533f03aa4653b82d492ded5b38..cd4e627f8b9f9e0ec02109d88fd2d231417dc98d 100644
--- a/dart/sdk/lib/_internal/lib/js_helper.dart
+++ b/dart/sdk/lib/_internal/lib/js_helper.dart
@@ -566,29 +566,15 @@ class Primitives {
return JS('var', '#.apply(#, #)', jsFunction, function, arguments);
}
- static jsConstructor(object) => JS('', '#.constructor', object);
-
static getConstructor(String className) {
// TODO(ahe): Generalize this and improve test coverage of
// reflecting on intercepted classes.
- if (JS('bool', '# == "String"', className)) {
- return jsConstructor(const JSString());
- }
- if (JS('bool', '# == "int"', className)) {
- return jsConstructor(const JSInt());
- }
- if (JS('bool', '# == "double"', className)) {
- return jsConstructor(const JSDouble());
- }
- if (JS('bool', '# == "num"', className)) {
- return jsConstructor(const JSNumber());
- }
- if (JS('bool', '# == "bool"', className)) {
- return jsConstructor(const JSBool());
- }
- if (JS('bool', '# == "List"', className)) {
- return jsConstructor(const JSArray());
- }
+ if (JS('bool', '# == "String"', className)) return const JSString();
+ if (JS('bool', '# == "int"', className)) return const JSInt();
+ if (JS('bool', '# == "double"', className)) return const JSDouble();
+ if (JS('bool', '# == "num"', className)) return const JSNumber();
+ if (JS('bool', '# == "bool"', className)) return const JSBool();
+ if (JS('bool', '# == "List"', className)) return const JSArray();
return JS('var', '#[#]', JS_CURRENT_ISOLATE(), className);
}
« no previous file with comments | « no previous file | dart/tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698