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

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

Issue 2512653002: Merge of source position information from kernel-sdk. (Closed)
Patch Set: Changed how GetTokenLocation was called back to original to fix failing failing tests. Created 4 years, 1 month 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
« no previous file with comments | « runtime/vm/bootstrap_nocore.cc ('k') | runtime/vm/kernel.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 "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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/bootstrap_nocore.cc ('k') | runtime/vm/kernel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698