| 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_entry.h" | 7 #include "vm/dart_entry.h" |
| 8 #include "vm/debugger.h" | 8 #include "vm/debugger.h" |
| 9 #include "vm/flags.h" | 9 #include "vm/flags.h" |
| 10 #include "vm/object.h" | 10 #include "vm/object.h" |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 Throw(Instance::Cast(result)); | 389 Throw(Instance::Cast(result)); |
| 390 } | 390 } |
| 391 } | 391 } |
| 392 | 392 |
| 393 | 393 |
| 394 RawObject* Exceptions::Create( | 394 RawObject* Exceptions::Create( |
| 395 ExceptionType type, const GrowableArray<const Object*>& arguments) { | 395 ExceptionType type, const GrowableArray<const Object*>& arguments) { |
| 396 Library& library = Library::Handle(); | 396 Library& library = Library::Handle(); |
| 397 String& class_name = String::Handle(); | 397 String& class_name = String::Handle(); |
| 398 switch (type) { | 398 switch (type) { |
| 399 case kIndexOutOfRange: | 399 case kRange: |
| 400 library = Library::CoreLibrary(); | 400 library = Library::CoreLibrary(); |
| 401 class_name = Symbols::New("IndexOutOfRangeException"); | 401 class_name = Symbols::New("RangeError"); |
| 402 break; | 402 break; |
| 403 case kArgument: | 403 case kArgument: |
| 404 library = Library::CoreLibrary(); | 404 library = Library::CoreLibrary(); |
| 405 class_name = Symbols::New("ArgumentError"); | 405 class_name = Symbols::New("ArgumentError"); |
| 406 break; | 406 break; |
| 407 case kNoSuchMethod: | 407 case kNoSuchMethod: |
| 408 library = Library::CoreLibrary(); | 408 library = Library::CoreLibrary(); |
| 409 class_name = Symbols::New("NoSuchMethodError"); | 409 class_name = Symbols::New("NoSuchMethodError"); |
| 410 break; | 410 break; |
| 411 case kFormat: | 411 case kFormat: |
| (...skipping 23 matching lines...) Expand all Loading... |
| 435 case kIsolateSpawn: | 435 case kIsolateSpawn: |
| 436 library = Library::IsolateLibrary(); | 436 library = Library::IsolateLibrary(); |
| 437 class_name = Symbols::New("IsolateSpawnException"); | 437 class_name = Symbols::New("IsolateSpawnException"); |
| 438 break; | 438 break; |
| 439 } | 439 } |
| 440 | 440 |
| 441 return DartLibraryCalls::ExceptionCreate(library, class_name, arguments); | 441 return DartLibraryCalls::ExceptionCreate(library, class_name, arguments); |
| 442 } | 442 } |
| 443 | 443 |
| 444 } // namespace dart | 444 } // namespace dart |
| OLD | NEW |