OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 /// Allows interoperability with Javascript APIs. | 5 /// Allows interoperability with Javascript APIs. |
6 library js; | 6 library js; |
7 | 7 |
8 export 'dart:js' show allowInterop, allowInteropCaptureThis; | 8 export 'dart:js' show allowInterop, allowInteropCaptureThis; |
9 | 9 |
10 /// A metadata annotation that indicates that a Library, Class, or member is | 10 /// A metadata annotation that indicates that a Library, Class, or member is |
11 /// implemented directly in JavaScript. All external members of a class or | 11 /// implemented directly in JavaScript. All external members of a class or |
12 /// library with this annotation implicitly have it as well. | 12 /// library with this annotation implicitly have it as well. |
13 /// | 13 /// |
14 /// Specifying [name] customizes the JavaScript name to use. By default the | 14 /// Specifying [name] customizes the JavaScript name to use. By default the |
15 /// dart name is used. It is not valid to specify a custom [name] for class | 15 /// dart name is used. It is not valid to specify a custom [name] for class |
16 /// instance members. | 16 /// instance members. |
17 class JS { | 17 class JS { |
18 final String name; | 18 final String name; |
19 const JS([this.name]); | 19 const JS([this.name]); |
20 } | 20 } |
| 21 |
| 22 class _Anonymous { |
| 23 const _Anonymous(); |
| 24 } |
| 25 |
| 26 /// A metadata annotation that indicates that a @JS annotated class is |
| 27 /// structural and does not have a known JavaScript prototype. |
| 28 /// |
| 29 /// Factory constructors for anonymous JavaScript classes desugar to creating |
| 30 /// JavaScript object literals with name-value pairs corresponding to the |
| 31 /// parameter names and values. |
| 32 const _Anonymous anonymous = const _Anonymous(); |
OLD | NEW |