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

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

Issue 37793004: Switch to lookup declaration by tag name. This fixes issue 14274. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 | « pkg/pkg.status ('k') | pkg/polymer/lib/src/instance.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/lib/src/declaration.dart
diff --git a/pkg/polymer/lib/src/declaration.dart b/pkg/polymer/lib/src/declaration.dart
index 22c2e863c99115adead45972b265bf421714d569..0a89318c9aafc3407d4c6d05151ff8d0f021d675 100644
--- a/pkg/polymer/lib/src/declaration.dart
+++ b/pkg/polymer/lib/src/declaration.dart
@@ -156,7 +156,7 @@ class PolymerDeclaration extends HtmlElement {
// back reference declaration element
// TODO(sjmiles): replace `element` with `elementElement` or `declaration`
- _declarations[_type] = this;
+ _declarations[name] = this;
// more declarative features
desugar();
@@ -192,7 +192,7 @@ class PolymerDeclaration extends HtmlElement {
// get basal prototype
_supertype = _getRegisteredType(extendee);
- if (supertype != null) _super = _getDeclaration(supertype);
+ if (_supertype != null) _super = _getDeclaration(extendee);
var cls = reflectClass(_type);
@@ -521,7 +521,6 @@ void _notifyType(String name) {
final Map _waitSuper = new Map<String, List<PolymerDeclaration>>();
void _notifySuper(String name) {
- _registered.add(name);
Siggi Cherem (dart-lang) 2013/10/24 02:25:08 (IIUC _notifySuper is called after the call to reg
var waiting = _waitSuper.remove(name);
if (waiting != null) {
for (var w in waiting) {
@@ -530,14 +529,11 @@ void _notifySuper(String name) {
}
}
-/// track document.register'ed tag names
-final Set _registered = new Set<String>();
+/// track document.register'ed tag names and their declarations
+final Map _declarations = new Map<String, PolymerDeclaration>();
-bool _isRegistered(name) => _registered.contains(name);
-
-final Map _declarations = new Map<Type, PolymerDeclaration>();
-
-PolymerDeclaration _getDeclaration(Type type) => _declarations[type];
+bool _isRegistered(String name) => _declarations.containsKey(name);
+PolymerDeclaration _getDeclaration(String name) => _declarations[name];
final _objectType = reflectClass(Object);
« no previous file with comments | « pkg/pkg.status ('k') | pkg/polymer/lib/src/instance.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698