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

Unified Diff: runtime/lib/mirrors.cc

Issue 20066004: Change the return value of setField to be in line with non-reflective assignments. Complete unwrapp… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | runtime/lib/mirrors_impl.dart » ('j') | runtime/tests/vm/dart/isolate_mirror_local_test.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/mirrors.cc
===================================================================
--- runtime/lib/mirrors.cc (revision 25390)
+++ runtime/lib/mirrors.cc (working copy)
@@ -1171,43 +1171,6 @@
}
-// TODO(11742): This is transitional.
-static RawInstance* Reflect(const Instance& reflectee) {
- Isolate* isolate = Isolate::Current();
- DARTSCOPE(isolate);
- return Instance::RawCast(
- Api::UnwrapHandle(
- CreateInstanceMirror(
- Api::NewHandle(isolate, reflectee.raw()))));
-}
-
-
-static void ThrowMirroredUnhandledError(const Error& original_error) {
- const UnhandledException& unhandled_ex =
- UnhandledException::Cast(original_error);
- Instance& exc = Instance::Handle(unhandled_ex.exception());
- Instance& stack = Instance::Handle(unhandled_ex.stacktrace());
-
- Object& exc_string_or_error =
- Object::Handle(DartLibraryCalls::ToString(exc));
- String& exc_string = String::Handle();
- // Ignore any errors that might occur in toString.
- if (exc_string_or_error.IsString()) {
- exc_string ^= exc_string_or_error.raw();
- }
-
- Instance& mirror_on_exc = Instance::Handle(Reflect(exc));
-
- Array& args = Array::Handle(Array::New(3));
- args.SetAt(0, mirror_on_exc);
- args.SetAt(1, exc_string);
- args.SetAt(2, stack);
-
- Exceptions::ThrowByType(Exceptions::kMirroredUncaughtExceptionError, args);
- UNREACHABLE();
-}
-
-
static void ThrowMirroredCompilationError(const String& message) {
Array& args = Array::Handle(Array::New(1));
args.SetAt(0, message);
@@ -1218,16 +1181,14 @@
static void ThrowInvokeError(const Error& error) {
- if (error.IsUnhandledException()) {
- // An ordinary runtime error.
- ThrowMirroredUnhandledError(error);
- }
if (error.IsLanguageError()) {
// A compilation error that was delayed by lazy compilation.
const LanguageError& compilation_error = LanguageError::Cast(error);
String& message = String::Handle(compilation_error.message());
ThrowMirroredCompilationError(message);
+ UNREACHABLE();
}
+ Exceptions::PropagateError(error);
UNREACHABLE();
}
« no previous file with comments | « no previous file | runtime/lib/mirrors_impl.dart » ('j') | runtime/tests/vm/dart/isolate_mirror_local_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698