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