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

Side by Side Diff: runtime/vm/exceptions.cc

Issue 9664029: Fix type check to perform a subtype test at top level instead of an (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/exceptions.h" 5 #include "vm/exceptions.h"
6 6
7 #include "vm/cpu.h" 7 #include "vm/cpu.h"
8 #include "vm/dart_entry.h" 8 #include "vm/dart_entry.h"
9 #include "vm/flags.h" 9 #include "vm/flags.h"
10 #include "vm/object.h" 10 #include "vm/object.h"
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 // Print type error information before throwing the error when debugging. 216 // Print type error information before throwing the error when debugging.
217 if (FLAG_print_stack_trace_at_throw) { 217 if (FLAG_print_stack_trace_at_throw) {
218 if (!malformed_error.IsNull()) { 218 if (!malformed_error.IsNull()) {
219 OS::Print("%s\n", malformed_error.ToCString()); 219 OS::Print("%s\n", malformed_error.ToCString());
220 } 220 }
221 intptr_t line, column; 221 intptr_t line, column;
222 script.GetTokenLocation(location, &line, &column); 222 script.GetTokenLocation(location, &line, &column);
223 OS::Print("'%s': Failed type check: line %d pos %d: ", 223 OS::Print("'%s': Failed type check: line %d pos %d: ",
224 String::Handle(script.url()).ToCString(), line, column); 224 String::Handle(script.url()).ToCString(), line, column);
225 if (!dst_name.IsNull() && (dst_name.Length() > 0)) { 225 if (!dst_name.IsNull() && (dst_name.Length() > 0)) {
226 OS::Print("type '%s' is not assignable to type '%s' of '%s'.\n", 226 OS::Print("type '%s' is not a subtype of type '%s' of '%s'.\n",
227 src_type_name.ToCString(), 227 src_type_name.ToCString(),
228 dst_type_name.ToCString(), 228 dst_type_name.ToCString(),
229 dst_name.ToCString()); 229 dst_name.ToCString());
230 } else { 230 } else {
231 OS::Print("malformed type used in type test.\n", 231 OS::Print("malformed type used.\n",
232 String::Handle(script.url()).ToCString(), 232 String::Handle(script.url()).ToCString(),
233 line, column); 233 line, column);
234 } 234 }
235 } 235 }
236 // Throw TypeError instance. 236 // Throw TypeError instance.
237 Exceptions::Throw(type_error); 237 Exceptions::Throw(type_error);
238 UNREACHABLE(); 238 UNREACHABLE();
239 } 239 }
240 240
241 241
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 break; 335 break;
336 case kIllegalJSRegExp: 336 case kIllegalJSRegExp:
337 class_name = String::NewSymbol("IllegalJSRegExpException"); 337 class_name = String::NewSymbol("IllegalJSRegExpException");
338 break; 338 break;
339 } 339 }
340 340
341 return DartLibraryCalls::ExceptionCreate(class_name, arguments); 341 return DartLibraryCalls::ExceptionCreate(class_name, arguments);
342 } 342 }
343 343
344 } // namespace dart 344 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698