| OLD | NEW |
| 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 import 'dart:collection' show Queue; | 5 import 'dart:collection' show Queue; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/backend_api.dart' show ForeignResolver; | 8 import '../common/backend_api.dart' show ForeignResolver; |
| 9 import '../common/registry.dart' show Registry; | 9 import '../common/registry.dart' show Registry; |
| 10 import '../common/resolution.dart' show Resolution; | 10 import '../common/resolution.dart' show Resolution; |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 void findAnnotationClasses() { | 289 void findAnnotationClasses() { |
| 290 if (_annotationCreatesClass != null) return; | 290 if (_annotationCreatesClass != null) return; |
| 291 ClassElement find(name) { | 291 ClassElement find(name) { |
| 292 Element e = helpers.findHelper(name); | 292 Element e = helpers.findHelper(name); |
| 293 if (e == null || e is! ClassElement) { | 293 if (e == null || e is! ClassElement) { |
| 294 reporter.internalError(NO_LOCATION_SPANNABLE, | 294 reporter.internalError(NO_LOCATION_SPANNABLE, |
| 295 "Could not find implementation class '${name}'."); | 295 "Could not find implementation class '${name}'."); |
| 296 } | 296 } |
| 297 return e; | 297 return e; |
| 298 } | 298 } |
| 299 |
| 299 _annotationCreatesClass = find('Creates'); | 300 _annotationCreatesClass = find('Creates'); |
| 300 _annotationReturnsClass = find('Returns'); | 301 _annotationReturnsClass = find('Returns'); |
| 301 _annotationJsNameClass = find('JSName'); | 302 _annotationJsNameClass = find('JSName'); |
| 302 } | 303 } |
| 303 | 304 |
| 304 /// Returns the JSName annotation string or `null` if no JSName annotation is | 305 /// Returns the JSName annotation string or `null` if no JSName annotation is |
| 305 /// present. | 306 /// present. |
| 306 String findJsNameFromAnnotation(Element element) { | 307 String findJsNameFromAnnotation(Element element) { |
| 307 String name = null; | 308 String name = null; |
| 308 ClassElement annotationClass = annotationJsNameClass; | 309 ClassElement annotationClass = annotationJsNameClass; |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 List<Element> directSubtypes = | 673 List<Element> directSubtypes = |
| 673 emitter.directSubtypes.putIfAbsent(superclass, () => <ClassElement>[]); | 674 emitter.directSubtypes.putIfAbsent(superclass, () => <ClassElement>[]); |
| 674 directSubtypes.add(cls); | 675 directSubtypes.add(cls); |
| 675 } | 676 } |
| 676 | 677 |
| 677 void logSummary(log(message)) { | 678 void logSummary(log(message)) { |
| 678 log('Compiled ${registeredClasses.length} native classes, ' | 679 log('Compiled ${registeredClasses.length} native classes, ' |
| 679 '${unusedClasses.length} native classes omitted.'); | 680 '${unusedClasses.length} native classes omitted.'); |
| 680 } | 681 } |
| 681 } | 682 } |
| OLD | NEW |