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

Side by Side Diff: pkg/js/lib/js.dart

Issue 1409033005: Add @anonymous annotation and restrict object literal constructors to only anonymous classes. This … (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: ptal 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 unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | pkg/js/pubspec.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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();
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | pkg/js/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698