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

Side by Side Diff: pkg/dev_compiler/tool/input_sdk/private/js_mirrors.dart

Issue 2827333003: Tighten up handling of JS types and add test. (Closed)
Patch Set: Tighten up handling of JS types. Fix bug where helpers in js_mirrors were specifying name had type … Created 3 years, 8 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 // 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 library dart._js_mirrors; 5 library dart._js_mirrors;
6 6
7 import 'dart:mirrors'; 7 import 'dart:mirrors';
8 import 'dart:_foreign_helper' show JS; 8 import 'dart:_foreign_helper' show JS;
9 import 'dart:_internal' as _internal; 9 import 'dart:_internal' as _internal;
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 return JS('', '#.value', property); 42 return JS('', '#.value', property);
43 } 43 }
44 // TODO(vsm): Might not be a class. 44 // TODO(vsm): Might not be a class.
45 var mirror = new JsClassMirror._(key); 45 var mirror = new JsClassMirror._(key);
46 JS('', '#[#] = #', unwrapped, _typeMirror, mirror); 46 JS('', '#[#] = #', unwrapped, _typeMirror, mirror);
47 return mirror; 47 return mirror;
48 } 48 }
49 49
50 final dynamic _dart = JS('', 'dart'); 50 final dynamic _dart = JS('', 'dart');
51 51
52 dynamic _dload(obj, String name) { 52 dynamic _dload(obj, name) {
53 return JS('', '#.dloadMirror(#, #)', _dart, obj, name); 53 return JS('', '#.dloadMirror(#, #)', _dart, obj, name);
54 } 54 }
55 55
56 void _dput(obj, String name, val) { 56 void _dput(obj, name, val) {
57 JS('', '#.dputMirror(#, #, #)', _dart, obj, name, val); 57 JS('', '#.dputMirror(#, #, #)', _dart, obj, name, val);
58 } 58 }
59 59
60 dynamic _dcall(obj, List args) { 60 dynamic _dcall(obj, List args) {
61 return JS('', '#.dcall(#, ...#)', _dart, obj, args); 61 return JS('', '#.dcall(#, ...#)', _dart, obj, args);
62 } 62 }
63 63
64 dynamic _dsend(obj, String name, List args) { 64 dynamic _dsend(obj, name, List args) {
65 return JS('', '#.dsend(#, #, ...#)', _dart, obj, name, args); 65 return JS('', '#.dsend(#, #, ...#)', _dart, obj, name, args);
66 } 66 }
67 67
68 dynamic _getGenericClass(obj) { 68 dynamic _getGenericClass(obj) {
69 return JS('', '#.getGenericClass(#)', _dart, obj); 69 return JS('', '#.getGenericClass(#)', _dart, obj);
70 } 70 }
71 71
72 dynamic _getGenericArgs(obj) { 72 dynamic _getGenericArgs(obj) {
73 return JS('', '#.getGenericArgs(#)', _dart, obj); 73 return JS('', '#.getGenericArgs(#)', _dart, obj);
74 } 74 }
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 var param = 654 var param =
655 new JsParameterMirror._(new Symbol(''), _wrap(type), metadata); 655 new JsParameterMirror._(new Symbol(''), _wrap(type), metadata);
656 params[i + args.length] = param; 656 params[i + args.length] = param;
657 } 657 }
658 658
659 _params = new List.unmodifiable(params); 659 _params = new List.unmodifiable(params);
660 } 660 }
661 661
662 String toString() => "MethodMirror on '$_name'"; 662 String toString() => "MethodMirror on '$_name'";
663 } 663 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698