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

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

Issue 196943024: Adding some asset-related utilities to code_transformers (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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 /// Contains logic to initialize polymer apps during development. This 5 /// Contains logic to initialize polymer apps during development. This
6 /// implementation uses dart:mirrors to load each library as they are discovered 6 /// implementation uses dart:mirrors to load each library as they are discovered
7 /// through HTML imports. This is only meant to be during development in 7 /// through HTML imports. This is only meant to be during development in
8 /// dartium, and the polymer transformers replace this implementation with 8 /// dartium, and the polymer transformers replace this implementation with
9 /// codege generation in the polymer-build steps. 9 /// codege generation in the polymer-build steps.
10 library polymer.src.mirror_loader; 10 library polymer.src.mirror_loader;
11 11
12 import 'dart:async'; 12 import 'dart:async';
13 import 'dart:html'; 13 import 'dart:html';
14 import 'dart:collection' show LinkedHashMap; 14 import 'dart:collection' show LinkedHashMap;
15 15
16 import 'package:code_transformers/assets.dart';
Siggi Cherem (dart-lang) 2014/03/18 19:06:25 is this one used?
blois 2014/03/18 19:41:25 Ack- had a resolve that was popping up in my searc
17
16 // Technically, we shouldn't need any @MirrorsUsed, since this is for 18 // Technically, we shouldn't need any @MirrorsUsed, since this is for
17 // development only, but our test bots don't yet run pub-build. See more details 19 // development only, but our test bots don't yet run pub-build. See more details
18 // on the comments of the mirrors import in `lib/polymer.dart`. 20 // on the comments of the mirrors import in `lib/polymer.dart`.
19 @MirrorsUsed(metaTargets: 21 @MirrorsUsed(metaTargets:
20 const [CustomTag, InitMethodAnnotation], 22 const [CustomTag, InitMethodAnnotation],
21 override: const ['smoke.mirrors', 'polymer.src.mirror_loader']) 23 override: const ['smoke.mirrors', 'polymer.src.mirror_loader'])
22 import 'dart:mirrors'; 24 import 'dart:mirrors';
23 25
24 import 'package:logging/logging.dart' show Logger; 26 import 'package:logging/logging.dart' show Logger;
25 import 'package:polymer/polymer.dart' show 27 import 'package:polymer/polymer.dart' show
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 " ${method.simpleName} is not."); 207 " ${method.simpleName} is not.");
206 return; 208 return;
207 } 209 }
208 if (!method.parameters.where((p) => !p.isOptional).isEmpty) { 210 if (!method.parameters.where((p) => !p.isOptional).isEmpty) {
209 print("warning: methods marked with @initMethod should take no " 211 print("warning: methods marked with @initMethod should take no "
210 "arguments, ${method.simpleName} expects some."); 212 "arguments, ${method.simpleName} expects some.");
211 return; 213 return;
212 } 214 }
213 initializers.add(() => obj.invoke(method.simpleName, const [])); 215 initializers.add(() => obj.invoke(method.simpleName, const []));
214 } 216 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698