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

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

Issue 2861503002: fix #29530, field metadata generation (Closed)
Patch Set: wip Created 3 years, 7 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 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 Symbol get simpleName => _symbol; 534 Symbol get simpleName => _symbol;
535 535
536 // TODO(vsm): Fix this 536 // TODO(vsm): Fix this
537 final bool isStatic = false; 537 final bool isStatic = false;
538 538
539 JsVariableMirror._(Symbol symbol, Type t, List annotations, 539 JsVariableMirror._(Symbol symbol, Type t, List annotations,
540 {this.isFinal: false}) 540 {this.isFinal: false})
541 : _symbol = symbol, 541 : _symbol = symbol,
542 _name = getName(symbol), 542 _name = getName(symbol),
543 type = reflectType(t), 543 type = reflectType(t),
544 metadata = 544 metadata = new List<InstanceMirror>.unmodifiable(
545 new List<InstanceMirror>.unmodifiable(annotations.map(reflect)); 545 annotations?.map(reflect) ?? []);
546 546
547 JsVariableMirror._fromField(Symbol symbol, fieldInfo) 547 JsVariableMirror._fromField(Symbol symbol, fieldInfo)
548 : this._(symbol, _wrap(JS('', '#.type', fieldInfo)), 548 : this._(symbol, _wrap(JS('', '#.type', fieldInfo)),
549 JS('', '#.metadata', fieldInfo), 549 JS('', '#.metadata', fieldInfo),
550 isFinal: JS('bool', '#.isFinal', fieldInfo)); 550 isFinal: JS('bool', '#.isFinal', fieldInfo));
551 551
552 String toString() => "VariableMirror on '$_name'"; 552 String toString() => "VariableMirror on '$_name'";
553 } 553 }
554 554
555 class JsParameterMirror extends JsVariableMirror implements ParameterMirror { 555 class JsParameterMirror extends JsVariableMirror implements ParameterMirror {
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 var param = 647 var param =
648 new JsParameterMirror._(new Symbol(''), _wrap(type), metadata); 648 new JsParameterMirror._(new Symbol(''), _wrap(type), metadata);
649 params[i + args.length] = param; 649 params[i + args.length] = param;
650 } 650 }
651 651
652 _params = new List.unmodifiable(params); 652 _params = new List.unmodifiable(params);
653 } 653 }
654 654
655 String toString() => "MethodMirror on '$_name'"; 655 String toString() => "MethodMirror on '$_name'";
656 } 656 }
OLDNEW
« no previous file with comments | « pkg/dev_compiler/lib/src/compiler/code_generator.dart ('k') | tests/lib_strong/mirrors/field_metadata2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698