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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 const Array& args = Array::Handle(zone, Array::New(4)); | 504 const Array& args = Array::Handle(zone, Array::New(4)); |
505 | 505 |
506 ExceptionType exception_type = | 506 ExceptionType exception_type = |
507 (bound_error_msg.IsNull() && | 507 (bound_error_msg.IsNull() && |
508 (dst_name.raw() == Symbols::InTypeCast().raw())) | 508 (dst_name.raw() == Symbols::InTypeCast().raw())) |
509 ? kCast | 509 ? kCast |
510 : kType; | 510 : kType; |
511 | 511 |
512 DartFrameIterator iterator; | 512 DartFrameIterator iterator; |
513 const Script& script = Script::Handle(zone, GetCallerScript(&iterator)); | 513 const Script& script = Script::Handle(zone, GetCallerScript(&iterator)); |
514 intptr_t line; | 514 intptr_t line = -1; |
515 intptr_t column = -1; | 515 intptr_t column = -1; |
516 if (script.HasSource()) { | 516 ASSERT(!script.IsNull()); |
| 517 if (location.IsReal()) { |
517 script.GetTokenLocation(location, &line, &column); | 518 script.GetTokenLocation(location, &line, &column); |
518 } else { | |
519 script.GetTokenLocation(location, &line, NULL); | |
520 } | 519 } |
521 // Initialize '_url', '_line', and '_column' arguments. | 520 // Initialize '_url', '_line', and '_column' arguments. |
522 args.SetAt(0, String::Handle(zone, script.url())); | 521 args.SetAt(0, String::Handle(zone, script.url())); |
523 args.SetAt(1, Smi::Handle(zone, Smi::New(line))); | 522 args.SetAt(1, Smi::Handle(zone, Smi::New(line))); |
524 args.SetAt(2, Smi::Handle(zone, Smi::New(column))); | 523 args.SetAt(2, Smi::Handle(zone, Smi::New(column))); |
525 | 524 |
526 // Construct '_errorMsg'. | 525 // Construct '_errorMsg'. |
527 const GrowableObjectArray& pieces = | 526 const GrowableObjectArray& pieces = |
528 GrowableObjectArray::Handle(zone, GrowableObjectArray::New(20)); | 527 GrowableObjectArray::Handle(zone, GrowableObjectArray::New(20)); |
529 | 528 |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 class_name = &Symbols::_CompileTimeError(); | 787 class_name = &Symbols::_CompileTimeError(); |
789 break; | 788 break; |
790 } | 789 } |
791 | 790 |
792 return DartLibraryCalls::InstanceCreate(library, *class_name, | 791 return DartLibraryCalls::InstanceCreate(library, *class_name, |
793 *constructor_name, arguments); | 792 *constructor_name, arguments); |
794 } | 793 } |
795 | 794 |
796 | 795 |
797 } // namespace dart | 796 } // namespace dart |
OLD | NEW |