| OLD | NEW |
| 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 dart._js_helper; | 5 part of dart._js_helper; |
| 6 | 6 |
| 7 /// Tells the optimizing compiler that the annotated method has no |
| 8 /// side-effects. Allocations don't count as side-effects, since they can be |
| 9 /// dropped without changing the semantics of the program. |
| 10 /// |
| 11 /// Requires @NoInline() to function correctly. |
| 12 class NoSideEffects { |
| 13 const NoSideEffects(); |
| 14 } |
| 15 |
| 7 /// Tells the optimizing compiler that the annotated method cannot throw. | 16 /// Tells the optimizing compiler that the annotated method cannot throw. |
| 8 /// Requires @NoInline() to function correctly. | 17 /// Requires @NoInline() to function correctly. |
| 9 class NoThrows { | 18 class NoThrows { |
| 10 const NoThrows(); | 19 const NoThrows(); |
| 11 } | 20 } |
| 12 | 21 |
| 13 /// Tells the optimizing compiler to not inline the annotated method. | 22 /// Tells the optimizing compiler to not inline the annotated method. |
| 14 class NoInline { | 23 class NoInline { |
| 15 const NoInline(); | 24 const NoInline(); |
| 16 } | 25 } |
| 17 | 26 |
| 27 /// Tells the optimizing compiler to always inline the annotated method. |
| 28 class ForceInline { |
| 29 const ForceInline(); |
| 30 } |
| 31 |
| 18 /// Marks a class as native and defines its JavaScript name(s). | 32 /// Marks a class as native and defines its JavaScript name(s). |
| 19 class Native { | 33 class Native { |
| 20 final String name; | 34 final String name; |
| 21 const Native(this.name); | 35 const Native(this.name); |
| 22 } | 36 } |
| 23 | 37 |
| 24 class JsPeerInterface { | 38 class JsPeerInterface { |
| 25 /// The JavaScript type that we should match the API of. | 39 /// The JavaScript type that we should match the API of. |
| 26 /// Used for classes where Dart subclasses should be callable from JavaScript | 40 /// Used for classes where Dart subclasses should be callable from JavaScript |
| 27 /// matching the JavaScript calling conventions. | 41 /// matching the JavaScript calling conventions. |
| 28 final String name; | 42 final String name; |
| 29 const JsPeerInterface({this.name}); | 43 const JsPeerInterface({this.name}); |
| 30 } | 44 } |
| 31 | 45 |
| 32 /// A Dart interface may only be implemented by a native JavaScript object | 46 /// A Dart interface may only be implemented by a native JavaScript object |
| 33 /// if it is marked with this annotation. | 47 /// if it is marked with this annotation. |
| 34 class SupportJsExtensionMethods { | 48 class SupportJsExtensionMethods { |
| 35 const SupportJsExtensionMethods(); | 49 const SupportJsExtensionMethods(); |
| 36 } | 50 } |
| OLD | NEW |