| 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 kNone: |
| 400 UNREACHABLE(); |
| 401 break; |
| 399 case kRange: | 402 case kRange: |
| 400 library = Library::CoreLibrary(); | 403 library = Library::CoreLibrary(); |
| 401 class_name = Symbols::New("RangeError"); | 404 class_name = Symbols::New("RangeError"); |
| 402 break; | 405 break; |
| 403 case kArgument: | 406 case kArgument: |
| 404 library = Library::CoreLibrary(); | 407 library = Library::CoreLibrary(); |
| 405 class_name = Symbols::New("ArgumentError"); | 408 class_name = Symbols::New("ArgumentError"); |
| 406 break; | 409 break; |
| 407 case kNoSuchMethod: | 410 case kNoSuchMethod: |
| 408 library = Library::CoreLibrary(); | 411 library = Library::CoreLibrary(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 425 class_name = Symbols::New("InternalError"); | 428 class_name = Symbols::New("InternalError"); |
| 426 break; | 429 break; |
| 427 case kNullPointer: | 430 case kNullPointer: |
| 428 library = Library::CoreLibrary(); | 431 library = Library::CoreLibrary(); |
| 429 class_name = Symbols::New("NullPointerException"); | 432 class_name = Symbols::New("NullPointerException"); |
| 430 break; | 433 break; |
| 431 case kIllegalJSRegExp: | 434 case kIllegalJSRegExp: |
| 432 library = Library::CoreLibrary(); | 435 library = Library::CoreLibrary(); |
| 433 class_name = Symbols::New("IllegalJSRegExpException"); | 436 class_name = Symbols::New("IllegalJSRegExpException"); |
| 434 break; | 437 break; |
| 438 case kArgumentError: |
| 439 library = Library::CoreLibrary(); |
| 440 class_name = Symbols::New("ArgumentError"); |
| 441 break; |
| 435 case kIsolateSpawn: | 442 case kIsolateSpawn: |
| 436 library = Library::IsolateLibrary(); | 443 library = Library::IsolateLibrary(); |
| 437 class_name = Symbols::New("IsolateSpawnException"); | 444 class_name = Symbols::New("IsolateSpawnException"); |
| 438 break; | 445 break; |
| 439 } | 446 } |
| 440 | 447 |
| 441 return DartLibraryCalls::ExceptionCreate(library, class_name, arguments); | 448 return DartLibraryCalls::ExceptionCreate(library, class_name, arguments); |
| 442 } | 449 } |
| 443 | 450 |
| 444 } // namespace dart | 451 } // namespace dart |
| OLD | NEW |