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

Unified Diff: pkg/js/README.md

Issue 1438003002: pkg/js: fix readme for pkg/js and prepare another release (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « CHANGELOG.md ('k') | pkg/js/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/js/README.md
diff --git a/pkg/js/README.md b/pkg/js/README.md
index e28092384b4fb89bd61abf9ec474993b06c3314a..19162f8e3dc58b9a599f7ed030cdc612a2484958 100644
--- a/pkg/js/README.md
+++ b/pkg/js/README.md
@@ -57,16 +57,21 @@ class Location {
}
```
-#### Maps
-
-Dart `Map` objects, including literals, are "opaque" in JavaScript.
-You must create Dart classes for each of these.
+#### JavaScript object literals
+Many JavaScript APIs take an object literal as an argument. For example:
```js
// JavaScript
printOptions({responsive: true});
```
+If you want to use `printOptions` from Dart, you cannot simply pass a Dart `Map`
+object – they are are "opaque" in JavaScript.
+
+
+Instead, create a Dart class with both the `@JS()` and
+`@anonymous` annotations.
+
```dart
// Dart
void main() {
@@ -77,6 +82,7 @@ void main() {
external printOptions(Options options);
@Js()
+@anonymous
class Options {
external bool get responsive;
@@ -86,7 +92,7 @@ class Options {
## Contributing and Filing Bugs
-Please file bugs and features requests on the [Github issue tracker](https://github.com/dart-lang/js-interop/issues).
+Please file bugs and features requests on the [Github issue tracker](https://github.com/dart-lang/sdk/issues).
We also love and accept community contributions, from API suggestions to pull requests.
Please file an issue before beginning work so we can discuss the design and implementation.
« no previous file with comments | « CHANGELOG.md ('k') | pkg/js/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698