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_api_impl.h" | 7 #include "vm/dart_api_impl.h" |
8 #include "vm/dart_entry.h" | 8 #include "vm/dart_entry.h" |
9 #include "vm/debugger.h" | 9 #include "vm/debugger.h" |
10 #include "vm/flags.h" | 10 #include "vm/flags.h" |
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 case kFallThrough: | 740 case kFallThrough: |
741 library = Library::CoreLibrary(); | 741 library = Library::CoreLibrary(); |
742 class_name = &Symbols::FallThroughError(); | 742 class_name = &Symbols::FallThroughError(); |
743 constructor_name = &Symbols::DotCreate(); | 743 constructor_name = &Symbols::DotCreate(); |
744 break; | 744 break; |
745 case kAbstractClassInstantiation: | 745 case kAbstractClassInstantiation: |
746 library = Library::CoreLibrary(); | 746 library = Library::CoreLibrary(); |
747 class_name = &Symbols::AbstractClassInstantiationError(); | 747 class_name = &Symbols::AbstractClassInstantiationError(); |
748 constructor_name = &Symbols::DotCreate(); | 748 constructor_name = &Symbols::DotCreate(); |
749 break; | 749 break; |
| 750 case kCyclicInitializationError: |
| 751 library = Library::CoreLibrary(); |
| 752 class_name = &Symbols::CyclicInitializationError(); |
750 } | 753 } |
751 | 754 |
752 return DartLibraryCalls::InstanceCreate(library, | 755 return DartLibraryCalls::InstanceCreate(library, |
753 *class_name, | 756 *class_name, |
754 *constructor_name, | 757 *constructor_name, |
755 arguments); | 758 arguments); |
756 } | 759 } |
757 | 760 |
758 | 761 |
759 // Throw JavascriptCompatibilityError exception. | 762 // Throw JavascriptCompatibilityError exception. |
760 void Exceptions::ThrowJavascriptCompatibilityError(const char* msg) { | 763 void Exceptions::ThrowJavascriptCompatibilityError(const char* msg) { |
761 const Array& exc_args = Array::Handle(Array::New(1)); | 764 const Array& exc_args = Array::Handle(Array::New(1)); |
762 const String& msg_str = String::Handle(String::New(msg)); | 765 const String& msg_str = String::Handle(String::New(msg)); |
763 exc_args.SetAt(0, msg_str); | 766 exc_args.SetAt(0, msg_str); |
764 Exceptions::ThrowByType(Exceptions::kJavascriptCompatibilityError, exc_args); | 767 Exceptions::ThrowByType(Exceptions::kJavascriptCompatibilityError, exc_args); |
765 } | 768 } |
766 | 769 |
767 } // namespace dart | 770 } // namespace dart |
OLD | NEW |