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

Unified 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, 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/compiler/lib/src/ssa/builder.dart ('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 4cb53c5479752c2fa9740ef4eaae6b78fef0a870..17b1ded20fe6c3cf7890b21f642afb89befe0b89 100644
--- a/pkg/js/lib/js.dart
+++ b/pkg/js/lib/js.dart
@@ -18,3 +18,15 @@ class JS {
final String name;
const JS([this.name]);
}
+
+class _Anonymous {
+ const _Anonymous();
+}
+
+/// A metadata annotation that indicates that a @JS annotated class is
+/// structural and does not have a known JavaScript prototype.
+///
+/// Factory constructors for anonymous JavaScript classes desugar to creating
+/// JavaScript object literals with name-value pairs corresponding to the
+/// parameter names and values.
+const _Anonymous anonymous = const _Anonymous();
« 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