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

Side by Side Diff: test_sources/non_transformed/lib/library2.dart

Issue 615913004: Add @jsify annotation. Support automatically proxying Lists and Maps to Dart in Proxies. Support co… (Closed) Base URL: https://github.com/dart-lang/js-interop.git@master
Patch Set: Created 6 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 unified diff | Download patch
OLDNEW
1 @Export() 1 @Export()
2 library test.library2; 2 library test.library2;
3 3
4 import 'package:js/js.dart'; 4 import 'package:js/js.dart';
5 5
6 6
7 abstract class Library2 extends JsInterface { 7 abstract class Library2 extends JsInterface {
8 factory Library2() => new Library2Impl(); 8 factory Library2() => new Library2Impl();
9 Library2.created(JsObject o) : super.created(o); 9 Library2.created(JsObject o) : super.created(o);
10 10
11 DartOnly createDartOnly(); 11 DartOnly createDartOnly();
12 12
13 Gizmo createGizmo(String x); 13 Gizmo createGizmo(String x);
14 14
15 JsAndDart createJsAndDart(int i); 15 JsAndDart createJsAndDart(int i);
16
17 List createList(a, b, c);
18
19 String joinList(@jsify List list);
20
21 // The returned object is only a transient wrapper on the underlying JS
22 // object. We might want to make this clear by requiring metadata like
23 // @JsMap. We also might want to support @dartify which would do a deep
24 // copy+convert from JS to Dart
25 Map<String, int> createMap(k1, v1, k2, v2);
26
27 String joinMap(@jsify Map<String, int> map);
16 } 28 }
17 29
18 @JsProxy(global: true) 30 @JsProxy(global: true)
19 class Library2Impl extends Library2 implements JsGlobal { 31 class Library2Impl extends Library2 implements JsGlobal {
20 factory Library2Impl() => new JsInterface(Library2Impl, []); 32 factory Library2Impl() => new JsInterface(Library2Impl, []);
21 Library2Impl.created(JsObject o) : super.created(o); 33 Library2Impl.created(JsObject o) : super.created(o);
22 noSuchMethod(i) => super.noSuchMethod(i); 34 noSuchMethod(i) => super.noSuchMethod(i);
23 } 35 }
24 36
25 @NoExport() 37 @NoExport()
(...skipping 12 matching lines...) Expand all
38 String get x; 50 String get x;
39 void set x(String x); 51 void set x(String x);
40 } 52 }
41 53
42 @JsProxy(constructor: 'namespace.Gizmo') 54 @JsProxy(constructor: 'namespace.Gizmo')
43 class GizmoImpl extends Gizmo { 55 class GizmoImpl extends Gizmo {
44 factory GizmoImpl(String x) => new JsInterface(GizmoImpl, [x]); 56 factory GizmoImpl(String x) => new JsInterface(GizmoImpl, [x]);
45 GizmoImpl.created(JsObject o) : super.created(o); 57 GizmoImpl.created(JsObject o) : super.created(o);
46 noSuchMethod(i) => super.noSuchMethod(i); 58 noSuchMethod(i) => super.noSuchMethod(i);
47 } 59 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698