| 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 "platform/address_sanitizer.h" | 7 #include "platform/address_sanitizer.h" |
| 8 | 8 |
| 9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 pieces.Add(Symbols::SingleQuote()); | 486 pieces.Add(Symbols::SingleQuote()); |
| 487 if (exception_type == kCast) { | 487 if (exception_type == kCast) { |
| 488 pieces.Add(dst_name); | 488 pieces.Add(dst_name); |
| 489 } else if (dst_name.Length() > 0) { | 489 } else if (dst_name.Length() > 0) { |
| 490 pieces.Add(Symbols::SpaceOfSpace()); | 490 pieces.Add(Symbols::SpaceOfSpace()); |
| 491 pieces.Add(Symbols::SingleQuote()); | 491 pieces.Add(Symbols::SingleQuote()); |
| 492 pieces.Add(dst_name); | 492 pieces.Add(dst_name); |
| 493 pieces.Add(Symbols::SingleQuote()); | 493 pieces.Add(Symbols::SingleQuote()); |
| 494 } | 494 } |
| 495 // Print URIs of src and dst types. | 495 // Print URIs of src and dst types. |
| 496 pieces.Add(Symbols::SpaceWhereNewLine()); | 496 // Do not print "where" when no URIs get printed. |
| 497 bool printed_where = false; |
| 497 if (!src_type.IsNull()) { | 498 if (!src_type.IsNull()) { |
| 498 pieces.Add(String::Handle(zone, src_type.EnumerateURIs())); | 499 const String& uris = String::Handle(zone, src_type.EnumerateURIs()); |
| 500 if (uris.Length() > Symbols::SpaceIsFromSpace().Length()) { |
| 501 printed_where = true; |
| 502 pieces.Add(Symbols::SpaceWhereNewLine()); |
| 503 pieces.Add(uris); |
| 504 } |
| 499 } | 505 } |
| 500 if (!dst_type.IsDynamicType() && !dst_type.IsVoidType()) { | 506 if (!dst_type.IsDynamicType() && !dst_type.IsVoidType()) { |
| 501 pieces.Add(String::Handle(zone, dst_type.EnumerateURIs())); | 507 const String& uris = String::Handle(zone, dst_type.EnumerateURIs()); |
| 508 if (uris.Length() > Symbols::SpaceIsFromSpace().Length()) { |
| 509 if (!printed_where) { |
| 510 pieces.Add(Symbols::SpaceWhereNewLine()); |
| 511 } |
| 512 pieces.Add(uris); |
| 513 } |
| 502 } | 514 } |
| 503 } | 515 } |
| 504 } | 516 } |
| 505 const String& error_msg = | 517 const String& error_msg = |
| 506 String::Handle(zone, Symbols::FromConcatAll(pieces)); | 518 String::Handle(zone, Symbols::FromConcatAll(pieces)); |
| 507 args.SetAt(3, error_msg); | 519 args.SetAt(3, error_msg); |
| 508 | 520 |
| 509 // Type errors in the core library may be difficult to diagnose. | 521 // Type errors in the core library may be difficult to diagnose. |
| 510 // Print type error information before throwing the error when debugging. | 522 // Print type error information before throwing the error when debugging. |
| 511 if (FLAG_print_stacktrace_at_throw) { | 523 if (FLAG_print_stacktrace_at_throw) { |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 } | 711 } |
| 700 | 712 |
| 701 return DartLibraryCalls::InstanceCreate(library, | 713 return DartLibraryCalls::InstanceCreate(library, |
| 702 *class_name, | 714 *class_name, |
| 703 *constructor_name, | 715 *constructor_name, |
| 704 arguments); | 716 arguments); |
| 705 } | 717 } |
| 706 | 718 |
| 707 | 719 |
| 708 } // namespace dart | 720 } // namespace dart |
| OLD | NEW |