Chromium Code Reviews| Index: pkg/js/lib/js.dart |
| diff --git a/pkg/js/lib/js.dart b/pkg/js/lib/js.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..af257e5b6880ed7914502f79a2ee7ace15273c1e |
| --- /dev/null |
| +++ b/pkg/js/lib/js.dart |
| @@ -0,0 +1,28 @@ |
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +/** |
| + * The js library allows Dart library authors to export their APIs to JavaScript |
| + * and to define Dart interfaces for JavaScript objects. |
| + */ |
| +library js; |
| + |
| +/// A metadata annotation that indicates that a Library, Class, or member is |
| +/// implemented directly in JavaScript. All external members of a class or |
| +/// library with this annotation implicitly have it as well. |
| +/// |
| +/// Specifying [name] customizes the JavaScript name to use. By default the |
| +/// dart name is used. It is not valid to specify a custom [name] for class |
| +/// instance members. |
|
sra1
2015/10/01 20:55:28
Comment needs examples.
Jacob
2015/10/02 20:08:16
Done.
|
| +class Js { |
| + final String name; |
| + const Js([this.name]); |
| +} |
| + |
| +/// A metadata annotation used to indicate that the Js object is a anonymous js |
| +/// object. That is it is created with `new Object()`. |
|
sra1
2015/10/01 20:55:28
Say why this is needed.
Add example.
Jacob
2015/10/02 20:08:16
Removed as we aren't using it yet.
|
| +const anonymous = const _Anonymous(); |
| +class _Anonymous { |
| + const _Anonymous(); |
| +} |