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

Unified Diff: pkg/polymer/lib/src/reflected_type.dart

Issue 108523003: Remove reflectedType hack from Polymer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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
« pkg/polymer/lib/src/loader.dart ('K') | « pkg/polymer/lib/src/loader.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/lib/src/reflected_type.dart
diff --git a/pkg/polymer/lib/src/reflected_type.dart b/pkg/polymer/lib/src/reflected_type.dart
deleted file mode 100644
index 6486abc4659a396f40e2c07c8875b920844df430..0000000000000000000000000000000000000000
--- a/pkg/polymer/lib/src/reflected_type.dart
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library polymer.src.reflected_type;
-
-// These are used by _getReflectedTypeWorkaround, see http://dartbug.com/12607
-@MirrorsUsed(targets:
- const ['_js_helper.createRuntimeType', 'dart._js_mirrors.JsClassMirror'],
- override: 'polymer.src.reflected_type')
-import 'dart:mirrors';
-
-// Horrible hack to work around: http://dartbug.com/12607
-Type getReflectedTypeWorkaround(ClassMirror cls) {
- // On Dart VM, just return reflectedType.
- if (1.0 is! int) return cls.reflectedType;
-
- var mangledName = reflect(cls).getField(_mangledNameField).reflectee;
- Type type = _jsHelper.invoke(#createRuntimeType, [mangledName]).reflectee;
- return type;
-}
-
-final LibraryMirror _jsHelper =
- currentMirrorSystem().libraries[Uri.parse('dart:_js_helper')];
-
-final Symbol _mangledNameField = () {
- var jsClassMirrorMirror = reflect(reflectClass(ClassMirror)).type;
- for (var name in jsClassMirrorMirror.declarations.keys) {
- if (MirrorSystem.getName(name) == '_mangledName') return name;
- }
-}();
« pkg/polymer/lib/src/loader.dart ('K') | « pkg/polymer/lib/src/loader.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698