| Index: runtime/lib/error.cc
|
| ===================================================================
|
| --- runtime/lib/error.cc (revision 1763)
|
| +++ runtime/lib/error.cc (working copy)
|
| @@ -158,6 +158,23 @@
|
| }
|
|
|
|
|
| +// Allocate and throw a new TypeError.
|
| +// Arg0: index of the token of the failed type check.
|
| +// Arg1: src value.
|
| +// Arg2: dst type name.
|
| +// Arg3: dst name.
|
| +// Return value: none, throws an exception.
|
| +DEFINE_NATIVE_ENTRY(TypeError_throwNew, 4) {
|
| + intptr_t location = Smi::CheckedHandle(arguments->At(0)).Value();
|
| + const Instance& src_value = Instance::CheckedHandle(arguments->At(1));
|
| + const String& dst_type_name = String::CheckedHandle(arguments->At(2));
|
| + const String& dst_name = String::CheckedHandle(arguments->At(3));
|
| + const String& src_type_name =
|
| + String::Handle(Type::Handle(src_value.GetType()).Name());
|
| + ThrowTypeError(location, src_type_name, dst_type_name, dst_name);
|
| +}
|
| +
|
| +
|
| // Allocate and throw a new FallThroughError.
|
| // Arg0: index of the case clause token into which we fall through.
|
| // Return value: none, throws an exception.
|
|
|