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

Unified Diff: runtime/vm/exceptions.cc

Issue 66033006: Check type bounds of redirecting factories (issue 14699). (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 | « runtime/vm/exceptions.h ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/exceptions.cc
===================================================================
--- runtime/vm/exceptions.cc (revision 30176)
+++ runtime/vm/exceptions.cc (working copy)
@@ -501,16 +501,16 @@
// Allocate, initialize, and throw a TypeError or CastError.
-// If bound_error is not null, throw a TypeError, even for a type cast.
+// If error_msg is not null, throw a TypeError, even for a type cast.
void Exceptions::CreateAndThrowTypeError(intptr_t location,
const String& src_type_name,
const String& dst_type_name,
const String& dst_name,
- const String& bound_error) {
+ const String& error_msg) {
const Array& args = Array::Handle(Array::New(7));
ExceptionType exception_type =
- (bound_error.IsNull() && dst_name.Equals(kCastErrorDstName)) ?
+ (error_msg.IsNull() && dst_name.Equals(kCastErrorDstName)) ?
kCast : kType;
DartFrameIterator iterator;
@@ -527,17 +527,17 @@
args.SetAt(1, Smi::Handle(Smi::New(line)));
args.SetAt(2, Smi::Handle(Smi::New(column)));
- // Initialize '_srcType', '_dstType', '_dstName', and '_boundError'.
+ // Initialize '_srcType', '_dstType', '_dstName', and '_errorMsg'.
args.SetAt(3, src_type_name);
args.SetAt(4, dst_type_name);
args.SetAt(5, dst_name);
- args.SetAt(6, bound_error);
+ args.SetAt(6, error_msg);
// Type errors in the core library may be difficult to diagnose.
// Print type error information before throwing the error when debugging.
if (FLAG_print_stacktrace_at_throw) {
- if (!bound_error.IsNull()) {
- OS::Print("%s\n", bound_error.ToCString());
+ if (!error_msg.IsNull()) {
+ OS::Print("%s\n", error_msg.ToCString());
}
OS::Print("'%s': Failed type check: line %" Pd " pos %" Pd ": ",
String::Handle(script.url()).ToCString(), line, column);
@@ -547,7 +547,7 @@
dst_type_name.ToCString(),
dst_name.ToCString());
} else {
- OS::Print("malbounded type used.\n");
+ OS::Print("type error.\n");
}
}
// Throw TypeError or CastError instance.
« no previous file with comments | « runtime/vm/exceptions.h ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698