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

Side by Side Diff: pkg/polymer/lib/src/loader.dart

Issue 68113022: Remove use of deprecated mirror functions from Polymer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/polymer/lib/src/instance.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of polymer; 5 part of polymer;
6 6
7 /** Annotation used to automatically register polymer elements. */ 7 /** Annotation used to automatically register polymer elements. */
8 class CustomTag { 8 class CustomTag {
9 final String tagName; 9 final String tagName;
10 const CustomTag(this.tagName); 10 const CustomTag(this.tagName);
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 lib = canonicalLib; 164 lib = canonicalLib;
165 } 165 }
166 } 166 }
167 167
168 if (lib == null) { 168 if (lib == null) {
169 _loaderLog.info('$uri library not found'); 169 _loaderLog.info('$uri library not found');
170 return; 170 return;
171 } 171 }
172 172
173 // Search top-level functions marked with @initMethod 173 // Search top-level functions marked with @initMethod
174 for (var f in lib.functions.values) { 174 for (var f in lib.declarations.values.where((d) => d is MethodMirror)) {
175 _maybeInvoke(lib, f); 175 _maybeInvoke(lib, f);
176 } 176 }
177 177
178 for (var c in lib.classes.values) { 178 for (var c in lib.declarations.values.where((d) => d is ClassMirror)) {
179 // Search for @CustomTag on classes 179 // Search for @CustomTag on classes
180 for (var m in c.metadata) { 180 for (var m in c.metadata) {
181 var meta = m.reflectee; 181 var meta = m.reflectee;
182 if (meta is CustomTag) { 182 if (meta is CustomTag) {
183 Polymer.register(meta.tagName, getReflectedTypeWorkaround(c)); 183 Polymer.register(meta.tagName, getReflectedTypeWorkaround(c));
184 } 184 }
185 } 185 }
186 186
187 // TODO(sigmund): check also static methods marked with @initMethod. 187 // TODO(sigmund): check also static methods marked with @initMethod.
188 // This is blocked on two bugs: 188 // This is blocked on two bugs:
(...skipping 22 matching lines...) Expand all
211 print("warning: methods marked with @initMethod should take no " 211 print("warning: methods marked with @initMethod should take no "
212 "arguments, ${method.simpleName} expects some."); 212 "arguments, ${method.simpleName} expects some.");
213 return; 213 return;
214 } 214 }
215 obj.invoke(method.simpleName, const []); 215 obj.invoke(method.simpleName, const []);
216 } 216 }
217 217
218 class _InitMethodAnnotation { 218 class _InitMethodAnnotation {
219 const _InitMethodAnnotation(); 219 const _InitMethodAnnotation();
220 } 220 }
OLDNEW
« no previous file with comments | « pkg/polymer/lib/src/instance.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698