| 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 js_backend.backend.annotations; | 5 library js_backend.backend.annotations; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../compiler.dart' show Compiler; | 8 import '../compiler.dart' show Compiler; |
| 9 import '../constants/values.dart'; | 9 import '../constants/values.dart'; |
| 10 import '../elements/elements.dart'; | 10 import '../elements/elements.dart'; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 } | 42 } |
| 43 } | 43 } |
| 44 } | 44 } |
| 45 | 45 |
| 46 /// Returns `true` if inlining is disabled for [element]. | 46 /// Returns `true` if inlining is disabled for [element]. |
| 47 bool noInline(Element element) { | 47 bool noInline(Element element) { |
| 48 if (_hasAnnotation(element, expectNoInlineClass)) { | 48 if (_hasAnnotation(element, expectNoInlineClass)) { |
| 49 // TODO(floitsch): restrict to elements from the test directory. | 49 // TODO(floitsch): restrict to elements from the test directory. |
| 50 return true; | 50 return true; |
| 51 } | 51 } |
| 52 return _hasAnnotation(element, backend.helpers.noInlineClass); | 52 return _hasAnnotation(element, compiler.commonElements.noInlineClass); |
| 53 } | 53 } |
| 54 | 54 |
| 55 /// Returns `true` if parameter and returns types should be trusted for | 55 /// Returns `true` if parameter and returns types should be trusted for |
| 56 /// [element]. | 56 /// [element]. |
| 57 bool trustTypeAnnotations(Element element) { | 57 bool trustTypeAnnotations(Element element) { |
| 58 return _hasAnnotation(element, expectTrustTypeAnnotationsClass); | 58 return _hasAnnotation(element, expectTrustTypeAnnotationsClass); |
| 59 } | 59 } |
| 60 | 60 |
| 61 /// Returns `true` if inference of parameter types is disabled for [element]. | 61 /// Returns `true` if inference of parameter types is disabled for [element]. |
| 62 bool assumeDynamic(Element element) { | 62 bool assumeDynamic(Element element) { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 76 ConstructedConstantValue constructedConstant = value; | 76 ConstructedConstantValue constructedConstant = value; |
| 77 if (constructedConstant.type.element == annotationClass) { | 77 if (constructedConstant.type.element == annotationClass) { |
| 78 return true; | 78 return true; |
| 79 } | 79 } |
| 80 } | 80 } |
| 81 } | 81 } |
| 82 return false; | 82 return false; |
| 83 }); | 83 }); |
| 84 } | 84 } |
| 85 } | 85 } |
| OLD | NEW |