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

Unified Diff: runtime/lib/errors.cc

Issue 1778133002: Enumerate URIs of all types in type errors in order to help the user diagnose (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: address comments Created 4 years, 9 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/errors_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/errors.cc
diff --git a/runtime/lib/errors.cc b/runtime/lib/errors.cc
index 785950b7a2ebd13b8f8d84b00205c8a05c987ee7..0387f803697ec952d208a1e63475fa0265f67b60 100644
--- a/runtime/lib/errors.cc
+++ b/runtime/lib/errors.cc
@@ -53,7 +53,7 @@ DEFINE_NATIVE_ENTRY(AssertionError_throwNew, 2) {
// Allocate and throw a new TypeError or CastError.
// Arg0: index of the token of the failed type check.
// Arg1: src value.
-// Arg2: dst type name.
+// Arg2: dst type.
// Arg3: dst name.
// Arg4: type error message.
// Return value: none, throws an exception.
@@ -64,14 +64,13 @@ DEFINE_NATIVE_ENTRY(TypeError_throwNew, 5) {
TokenPosition(Smi::CheckedHandle(arguments->NativeArgAt(0)).Value());
const Instance& src_value =
Instance::CheckedHandle(arguments->NativeArgAt(1));
- const String& dst_type_name =
- String::CheckedHandle(arguments->NativeArgAt(2));
+ const AbstractType& dst_type =
+ AbstractType::CheckedHandle(arguments->NativeArgAt(2));
const String& dst_name = String::CheckedHandle(arguments->NativeArgAt(3));
const String& error_msg = String::CheckedHandle(arguments->NativeArgAt(4));
- const String& src_type_name = String::Handle(
- AbstractType::Handle(src_value.GetType()).UserVisibleName());
- Exceptions::CreateAndThrowTypeError(location, src_type_name,
- dst_type_name, dst_name, error_msg);
+ const AbstractType& src_type = AbstractType::Handle(src_value.GetType());
+ Exceptions::CreateAndThrowTypeError(
+ location, src_type, dst_type, dst_name, error_msg);
UNREACHABLE();
return Object::null();
}
« no previous file with comments | « no previous file | runtime/lib/errors_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698