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

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

Issue 204143002: Changes in smoke in preparation of polymer's codegen: (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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/polymer/lib/polymer.dart ('k') | pkg/smoke/lib/codegen/generator.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 0fb09c2a9e53801695c4258a7f71ab32d9616b16..e79f8bd9b88214d47ab6b8eb6dfc9c3474142dfa 100644
--- a/pkg/polymer/lib/src/declaration.dart
+++ b/pkg/polymer/lib/src/declaration.dart
@@ -186,7 +186,7 @@ class PolymerDeclaration {
// do not override explicit entries
if (attr == '') continue;
- var property = new Symbol(attr);
+ var property = smoke.nameToSymbol(attr);
var path = new PropertyPath([property]);
if (_publish != null && _publish.containsKey(path)) {
continue;
@@ -350,18 +350,13 @@ class PolymerDeclaration {
/// Fetch a list of all *Changed methods so we can observe the associated
/// properties.
void inferObservers() {
- var options = const smoke.QueryOptions(includeFields: false,
- includeProperties: false, includeMethods: true, includeInherited: true,
- includeUpTo: HtmlElement);
- for (var decl in smoke.query(type, options)) {
- String name = smoke.symbolToName(decl.name);
- if (name.endsWith(_OBSERVE_SUFFIX) && name != 'attributeChanged') {
- // TODO(jmesserly): now that we have a better system, should we
- // deprecate *Changed methods?
- if (_observe == null) _observe = new HashMap();
- name = name.substring(0, name.length - 7);
- _observe[new PropertyPath(name)] = [decl.name];
- }
+ for (var decl in smoke.query(type, _changedMethodQueryOptions)) {
+ // TODO(jmesserly): now that we have a better system, should we
+ // deprecate *Changed methods?
+ if (_observe == null) _observe = new HashMap();
+ var name = smoke.symbolToName(decl.name);
+ name = name.substring(0, name.length - 7);
+ _observe[new PropertyPath(name)] = [decl.name];
}
}
@@ -478,7 +473,17 @@ String _cssTextFromSheet(LinkElement sheet) {
final Logger _sheetLog = new Logger('polymer.stylesheet');
-const _OBSERVE_SUFFIX = 'Changed';
+
+final smoke.QueryOptions _changedMethodQueryOptions = new smoke.QueryOptions(
+ includeFields: false, includeProperties: false, includeMethods: true,
+ includeInherited: true, includeUpTo: HtmlElement,
+ matches: _isObserverMethod);
+
+bool _isObserverMethod(Symbol symbol) {
+ String name = smoke.symbolToName(symbol);
+ if (name == null) return false;
+ return name.endsWith('Changed') && name != 'attributeChanged';
+}
// TODO(jmesserly): is this list complete?
final _eventTranslations = const {
« no previous file with comments | « pkg/polymer/lib/polymer.dart ('k') | pkg/smoke/lib/codegen/generator.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698