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

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

Issue 63483002: Fix some users of removed mirror API. (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
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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 lib = canonicalLib; 162 lib = canonicalLib;
163 } 163 }
164 } 164 }
165 165
166 if (lib == null) { 166 if (lib == null) {
167 print('warning: $uri library not found'); 167 print('warning: $uri library not found');
168 return; 168 return;
169 } 169 }
170 170
171 // Search top-level functions marked with @initMethod 171 // Search top-level functions marked with @initMethod
172 for (var f in lib.functions.values) { 172 for (var f in lib.declarations.values.where((d) => d is MethodMirror)) {
173 _maybeInvoke(lib, f); 173 _maybeInvoke(lib, f);
174 } 174 }
175 175
176 for (var c in lib.classes.values) { 176 for (var c in lib.declarations.values.where((d) => d is ClassMirror)) {
177 // Search for @CustomTag on classes 177 // Search for @CustomTag on classes
178 for (var m in c.metadata) { 178 for (var m in c.metadata) {
179 var meta = m.reflectee; 179 var meta = m.reflectee;
180 if (meta is CustomTag) { 180 if (meta is CustomTag) {
181 Polymer.register(meta.tagName, getReflectedTypeWorkaround(c)); 181 Polymer.register(meta.tagName, getReflectedTypeWorkaround(c));
182 } 182 }
183 } 183 }
184 184
185 // TODO(sigmund): check also static methods marked with @initMethod. 185 // TODO(sigmund): check also static methods marked with @initMethod.
186 // This is blocked on two bugs: 186 // This is blocked on two bugs:
(...skipping 22 matching lines...) Expand all
209 print("warning: methods marked with @initMethod should take no " 209 print("warning: methods marked with @initMethod should take no "
210 "arguments, ${method.simpleName} expects some."); 210 "arguments, ${method.simpleName} expects some.");
211 return; 211 return;
212 } 212 }
213 obj.invoke(method.simpleName, const []); 213 obj.invoke(method.simpleName, const []);
214 } 214 }
215 215
216 class _InitMethodAnnotation { 216 class _InitMethodAnnotation {
217 const _InitMethodAnnotation(); 217 const _InitMethodAnnotation();
218 } 218 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698