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

Unified Diff: runtime/lib/mirrors_impl.dart

Issue 46893004: - Force errors when using bad types or overrides. (Closed) Base URL: http://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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/language/hello_dart_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/mirrors_impl.dart
===================================================================
--- runtime/lib/mirrors_impl.dart (revision 29812)
+++ runtime/lib/mirrors_impl.dart (working copy)
@@ -49,9 +49,10 @@
void clear() => _throw();
}
-// These values are allowed to be passed directly over the wire.
-bool _isSimpleValue(var value) {
- return (value == null || value is num || value is String || value is bool);
+class _InternalMirrorError {
+ const _InternalError(String this._msg);
+ String toString() => _msg;
+ final String _msg;
}
Map _filterMap(Map<Symbol, dynamic> old_map, bool filter(Symbol key, value)) {
@@ -216,19 +217,6 @@
value);
return reflect(value);
}
-
- static _validateArgument(int i, Object arg)
- {
- if (arg is Mirror) {
- if (arg is! InstanceMirror) {
- throw new MirrorException(
- 'positional argument $i ($arg) was not an InstanceMirror');
- }
- } else if (!_isSimpleValue(arg)) {
- throw new MirrorException(
- 'positional argument $i ($arg) was not a simple value');
- }
- }
}
class _LocalInstanceMirrorImpl extends _LocalObjectMirrorImpl
@@ -1252,7 +1240,7 @@
} else {
var parts = MirrorSystem.getName(simpleName).split('.');
if (parts.length > 2) {
- throw new MirrorException(
+ throw new _InternalMirrorError(
'Internal error in MethodMirror.constructorName: '
'malformed name <$simpleName>');
} else if (parts.length == 2) {
« no previous file with comments | « no previous file | tests/language/hello_dart_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698