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

Unified Diff: runtime/vm/code_generator.cc

Issue 9705041: Fix 2172: report 'int' instead of Smi, Mint and Bigint when throwing TypeError. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | tests/language/src/TypeVMTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_generator.cc
===================================================================
--- runtime/vm/code_generator.cc (revision 5480)
+++ runtime/vm/code_generator.cc (working copy)
@@ -467,7 +467,13 @@
}
if (!is_instance_of) {
const Type& src_type = Type::Handle(src_instance.GetType());
- const String& src_type_name = String::Handle(src_type.Name());
+ String& src_type_name = String::Handle();
+ if (src_instance.IsInteger()) {
+ // Hide implementation detail (Smi, Mint, Bigint).
+ src_type_name = String::NewSymbol("int");
+ } else {
+ src_type_name = src_type.Name();
+ }
String& dst_type_name = String::Handle();
if (!dst_type.IsInstantiated()) {
// Instantiate dst_type before reporting the error.
« no previous file with comments | « no previous file | tests/language/src/TypeVMTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698