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

Side by Side Diff: pkg/polymer/lib/src/instance.dart

Issue 68113022: Remove use of deprecated mirror functions from Polymer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « pkg/polymer/lib/src/declaration.dart ('k') | pkg/polymer/lib/src/loader.dart » ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 part of polymer; 5 part of polymer;
6 6
7 /** 7 /**
8 * Use this annotation to publish a field as an attribute. For example: 8 * Use this annotation to publish a field as an attribute. For example:
9 * 9 *
10 * class MyPlaybackElement extends PolymerElement { 10 * class MyPlaybackElement extends PolymerElement {
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after
787 /** Call [methodName] method on this object with [args]. */ 787 /** Call [methodName] method on this object with [args]. */
788 invokeMethod(Symbol methodName, List args) => 788 invokeMethod(Symbol methodName, List args) =>
789 _invokeMethod(this, methodName, args); 789 _invokeMethod(this, methodName, args);
790 790
791 /** Call [methodName] method on [receiver] with [args]. */ 791 /** Call [methodName] method on [receiver] with [args]. */
792 static _invokeMethod(receiver, Symbol methodName, List args) { 792 static _invokeMethod(receiver, Symbol methodName, List args) {
793 // TODO(sigmund): consider making callbacks list all arguments 793 // TODO(sigmund): consider making callbacks list all arguments
794 // explicitly. Unless VM mirrors are optimized first, this will be expensive 794 // explicitly. Unless VM mirrors are optimized first, this will be expensive
795 // once custom elements extend directly from Element (see issue 11108). 795 // once custom elements extend directly from Element (see issue 11108).
796 var receiverMirror = reflect(receiver); 796 var receiverMirror = reflect(receiver);
797 var method = receiverMirror.type.methods[methodName]; 797 var method = receiverMirror.type.declarations[methodName];
798 if (method != null) { 798 if (method != null && method is MethodMirror) {
799 // This will either truncate the argument list or extend it with extra 799 // This will either truncate the argument list or extend it with extra
800 // null arguments, so it will match the signature. 800 // null arguments, so it will match the signature.
801 // TODO(sigmund): consider accepting optional arguments when we can tell 801 // TODO(sigmund): consider accepting optional arguments when we can tell
802 // them appart from named arguments (see http://dartbug.com/11334) 802 // them appart from named arguments (see http://dartbug.com/11334)
803 args.length = method.parameters.where((p) => !p.isOptional).length; 803 args.length = method.parameters.where((p) => !p.isOptional).length;
804 } 804 }
805 return receiverMirror.invoke(methodName, args).reflectee; 805 return receiverMirror.invoke(methodName, args).reflectee;
806 } 806 }
807 807
808 /** 808 /**
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
1073 1073
1074 class _PropertyValue { 1074 class _PropertyValue {
1075 Object oldValue, newValue; 1075 Object oldValue, newValue;
1076 _PropertyValue(this.oldValue); 1076 _PropertyValue(this.oldValue);
1077 } 1077 }
1078 1078
1079 class _PolymerExpressionsWithEventDelegate extends PolymerExpressions { 1079 class _PolymerExpressionsWithEventDelegate extends PolymerExpressions {
1080 prepareBinding(String path, name, node) => 1080 prepareBinding(String path, name, node) =>
1081 Polymer.prepareBinding(path, name, node, super.prepareBinding); 1081 Polymer.prepareBinding(path, name, node, super.prepareBinding);
1082 } 1082 }
OLDNEW
« no previous file with comments | « pkg/polymer/lib/src/declaration.dart ('k') | pkg/polymer/lib/src/loader.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698