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

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

Issue 1411503002: pkg/js: improved readme, added example (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: nits Created 5 years, 2 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
« no previous file with comments | « pkg/js/example/index.html ('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/lib/js.dart
diff --git a/pkg/js/lib/js.dart b/pkg/js/lib/js.dart
index c31794b2a5b146fdbf5eb61678389dcdff45c7e2..16555a7d22640e47db557363a416cabab264032f 100644
--- a/pkg/js/lib/js.dart
+++ b/pkg/js/lib/js.dart
@@ -1,11 +1,8 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2015, 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.
- */
+/// Allows interoperability with Javascript APIs.
library js;
export 'dart:js' show allowInterop, allowInteropCaptureThis;
@@ -17,51 +14,6 @@ export 'dart:js' show allowInterop, allowInteropCaptureThis;
/// 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.
-///
-/// Example 1:
-///
-/// @Js('google.maps')
-/// library maps;
-///
-/// external Map get map;
-///
-/// @Js("LatLng")
-/// class Location {
-/// external Location(num lat, num lng);
-/// }
-///
-/// @Js()
-/// class Map {
-/// external Map(Location location);
-/// external Location getLocation();
-/// }
-///
-/// In this example the top level map getter will invoke the JavaScript getter
-/// google.maps.map
-/// Calls to the Map constructor will be translated to calls to the JavaScript
-/// new google.maps.Map(location)
-/// Calls to the Location constructor willbe translated to calls to the
-/// JavaScript
-/// new google.maps.LatLng(lat, lng)
-/// because a custom JavaScript name for the Location class.
-/// In general, we recommend against using custom JavaScript names whenever
-/// possible as it is easier for users if the JavaScript names and Dart names
-/// are consistent.
-///
-/// Example 2:
-/// library utils;
-///
-/// @Js("JSON.stringify")
-/// external String stringify(obj);
-///
-/// @Js()
-/// void debugger();
-///
-/// In this example no custom JavaScript namespace is specified.
-/// Calls to debugger map to calls to JavaScript
-/// self.debugger()
-/// Calls to stringify map to calls to
-/// JSON.stringify(obj)
class Js {
final String name;
const Js([this.name]);
« no previous file with comments | « pkg/js/example/index.html ('k') | pkg/js/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698