| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 library dart2js.resolution_strategy; | 5 library dart2js.resolution_strategy; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common_elements.dart'; | 8 import '../common_elements.dart'; |
| 9 import '../common/backend_api.dart'; | 9 import '../common/backend_api.dart'; |
| 10 import '../common/names.dart'; | 10 import '../common/names.dart'; |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 ConstantValue constant = | 512 ConstantValue constant = |
| 513 _compiler.constants.getConstantValue(annotation.constant); | 513 _compiler.constants.getConstantValue(annotation.constant); |
| 514 if (constant == null || constant is! ConstructedConstantValue) continue; | 514 if (constant == null || constant is! ConstructedConstantValue) continue; |
| 515 ConstructedConstantValue constructedConstant = constant; | 515 ConstructedConstantValue constructedConstant = constant; |
| 516 if (constructedConstant.type.element == | 516 if (constructedConstant.type.element == |
| 517 _commonElements.jsAnnotationClass) { | 517 _commonElements.jsAnnotationClass) { |
| 518 ConstantValue value = constructedConstant.fields[nameField]; | 518 ConstantValue value = constructedConstant.fields[nameField]; |
| 519 String name; | 519 String name; |
| 520 if (value.isString) { | 520 if (value.isString) { |
| 521 StringConstantValue stringValue = value; | 521 StringConstantValue stringValue = value; |
| 522 name = stringValue.primitiveValue.slowToString(); | 522 name = stringValue.primitiveValue; |
| 523 } else { | 523 } else { |
| 524 // TODO(jacobr): report a warning if the value is not a String. | 524 // TODO(jacobr): report a warning if the value is not a String. |
| 525 name = ''; | 525 name = ''; |
| 526 } | 526 } |
| 527 return name; | 527 return name; |
| 528 } | 528 } |
| 529 } | 529 } |
| 530 return null; | 530 return null; |
| 531 } | 531 } |
| 532 | 532 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 } | 635 } |
| 636 } | 636 } |
| 637 }); | 637 }); |
| 638 }); | 638 }); |
| 639 } | 639 } |
| 640 | 640 |
| 641 _compiler.libraryLoader.libraries | 641 _compiler.libraryLoader.libraries |
| 642 .forEach(processJsInteropAnnotationsInLibrary); | 642 .forEach(processJsInteropAnnotationsInLibrary); |
| 643 } | 643 } |
| 644 } | 644 } |
| OLD | NEW |