OLD | NEW |
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/dart_api_impl.h" | 7 #include "vm/dart_api_impl.h" |
8 #include "vm/dart_entry.h" | 8 #include "vm/dart_entry.h" |
9 #include "vm/debugger.h" | 9 #include "vm/debugger.h" |
10 #include "vm/flags.h" | 10 #include "vm/flags.h" |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 args.SetAt(6, malformed_error); | 532 args.SetAt(6, malformed_error); |
533 | 533 |
534 // Type errors in the core library may be difficult to diagnose. | 534 // Type errors in the core library may be difficult to diagnose. |
535 // Print type error information before throwing the error when debugging. | 535 // Print type error information before throwing the error when debugging. |
536 if (FLAG_print_stacktrace_at_throw) { | 536 if (FLAG_print_stacktrace_at_throw) { |
537 if (!malformed_error.IsNull()) { | 537 if (!malformed_error.IsNull()) { |
538 OS::Print("%s\n", malformed_error.ToCString()); | 538 OS::Print("%s\n", malformed_error.ToCString()); |
539 } | 539 } |
540 intptr_t line, column; | 540 intptr_t line, column; |
541 script.GetTokenLocation(location, &line, &column); | 541 script.GetTokenLocation(location, &line, &column); |
542 OS::Print("'%s': Failed type check: line %"Pd" pos %"Pd": ", | 542 OS::Print("'%s': Failed type check: line %" Pd " pos %" Pd ": ", |
543 String::Handle(script.url()).ToCString(), line, column); | 543 String::Handle(script.url()).ToCString(), line, column); |
544 if (!dst_name.IsNull() && (dst_name.Length() > 0)) { | 544 if (!dst_name.IsNull() && (dst_name.Length() > 0)) { |
545 OS::Print("type '%s' is not a subtype of type '%s' of '%s'.\n", | 545 OS::Print("type '%s' is not a subtype of type '%s' of '%s'.\n", |
546 src_type_name.ToCString(), | 546 src_type_name.ToCString(), |
547 dst_type_name.ToCString(), | 547 dst_type_name.ToCString(), |
548 dst_name.ToCString()); | 548 dst_name.ToCString()); |
549 } else { | 549 } else { |
550 OS::Print("malformed type used.\n"); | 550 OS::Print("malformed type used.\n"); |
551 } | 551 } |
552 } | 552 } |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 break; | 710 break; |
711 } | 711 } |
712 | 712 |
713 return DartLibraryCalls::InstanceCreate(library, | 713 return DartLibraryCalls::InstanceCreate(library, |
714 *class_name, | 714 *class_name, |
715 *constructor_name, | 715 *constructor_name, |
716 arguments); | 716 arguments); |
717 } | 717 } |
718 | 718 |
719 } // namespace dart | 719 } // namespace dart |
OLD | NEW |