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

Unified Diff: sdk/lib/_internal/lib/js_mirrors.dart

Issue 414833002: Support class-setters in reflection. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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 | « no previous file | tests/lib/lib.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/lib/js_mirrors.dart
diff --git a/sdk/lib/_internal/lib/js_mirrors.dart b/sdk/lib/_internal/lib/js_mirrors.dart
index b4a250d4a28c02cd7c7a341898906344f1f648e5..1c0292fad62f9431f1167306ae1ebac19acab817 100644
--- a/sdk/lib/_internal/lib/js_mirrors.dart
+++ b/sdk/lib/_internal/lib/js_mirrors.dart
@@ -1798,8 +1798,15 @@ class JsClassMirror extends JsTypeMirror with JsObjectMirror
JS('void', '#[#] = #', JS_CURRENT_ISOLATE(), jsName, arg);
return reflect(arg);
}
- throw new NoSuchStaticMethodError.method(
- null, setterSymbol(fieldName), [arg], null);
+ Symbol setterName = setterSymbol(fieldName);
+ if (mirror == null) {
+ JsMethodMirror setter = __setters[setterName];
+ if (setter != null) {
+ setter._invoke([arg], const {});
+ return reflect(arg);
+ }
+ }
+ throw new NoSuchStaticMethodError.method(null, setterName, [arg], null);
}
bool _staticFieldExists(Symbol fieldName) {
« no previous file with comments | « no previous file | tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698