Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(529)

Unified Diff: pkg/js/lib/js.dart

Issue 1318043005: Support user generated custom native JS classes. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: ptal Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();
+}

Powered by Google App Engine
This is Rietveld 408576698