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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 return caller.script(); | 387 return caller.script(); |
388 } | 388 } |
389 | 389 |
390 | 390 |
391 // Allocate a new instance of the given class name. | 391 // Allocate a new instance of the given class name. |
392 // TODO(hausner): Rename this NewCoreInstance to call out the fact that | 392 // TODO(hausner): Rename this NewCoreInstance to call out the fact that |
393 // the class name is resolved in the core library implicitly? | 393 // the class name is resolved in the core library implicitly? |
394 RawInstance* Exceptions::NewInstance(const char* class_name) { | 394 RawInstance* Exceptions::NewInstance(const char* class_name) { |
395 const String& cls_name = String::Handle(Symbols::New(class_name)); | 395 const String& cls_name = String::Handle(Symbols::New(class_name)); |
396 const Library& core_lib = Library::Handle(Library::CoreLibrary()); | 396 const Library& core_lib = Library::Handle(Library::CoreLibrary()); |
397 Class& cls = Class::Handle(core_lib.LookupClass(cls_name)); | 397 // No ambiguity error expected: passing NULL. |
| 398 Class& cls = Class::Handle(core_lib.LookupClass(cls_name, NULL)); |
398 ASSERT(!cls.IsNull()); | 399 ASSERT(!cls.IsNull()); |
399 // There are no parameterized error types, so no need to set type arguments. | 400 // There are no parameterized error types, so no need to set type arguments. |
400 return Instance::New(cls); | 401 return Instance::New(cls); |
401 } | 402 } |
402 | 403 |
403 | 404 |
404 // Assign the value to the field given by its name in the given instance. | 405 // Assign the value to the field given by its name in the given instance. |
405 void Exceptions::SetField(const Instance& instance, | 406 void Exceptions::SetField(const Instance& instance, |
406 const Class& cls, | 407 const Class& cls, |
407 const char* field_name, | 408 const char* field_name, |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 break; | 629 break; |
629 } | 630 } |
630 | 631 |
631 return DartLibraryCalls::InstanceCreate(library, | 632 return DartLibraryCalls::InstanceCreate(library, |
632 *class_name, | 633 *class_name, |
633 *constructor_name, | 634 *constructor_name, |
634 arguments); | 635 arguments); |
635 } | 636 } |
636 | 637 |
637 } // namespace dart | 638 } // namespace dart |
OLD | NEW |