| Index: vm/dart_api_impl.cc
|
| ===================================================================
|
| --- vm/dart_api_impl.cc (revision 4552)
|
| +++ vm/dart_api_impl.cc (working copy)
|
| @@ -2451,9 +2451,6 @@
|
| RETURN_TYPE_ERROR(source, String);
|
| }
|
| const Array& mapping_array = Api::UnwrapArrayHandle(import_map);
|
| - if (mapping_array.IsNull()) {
|
| - RETURN_TYPE_ERROR(import_map, Array);
|
| - }
|
| Library& library = Library::Handle(isolate->object_store()->root_library());
|
| if (!library.IsNull()) {
|
| const String& library_url = String::Handle(library.url());
|
| @@ -2462,7 +2459,11 @@
|
| }
|
| isolate->set_library_tag_handler(handler);
|
| library = Library::New(url_str);
|
| - library.set_import_map(mapping_array);
|
| + if (mapping_array.IsNull()) {
|
| + library.set_import_map(Array::Handle(Array::Empty()));
|
| + } else {
|
| + library.set_import_map(mapping_array);
|
| + }
|
| library.Register();
|
| isolate->object_store()->set_root_library(library);
|
| Dart_Handle result;
|
| @@ -2603,13 +2604,14 @@
|
| RETURN_TYPE_ERROR(source, String);
|
| }
|
| const Array& mapping_array = Api::UnwrapArrayHandle(import_map);
|
| - if (mapping_array.IsNull()) {
|
| - RETURN_TYPE_ERROR(import_map, Array);
|
| - }
|
| Library& library = Library::Handle(Library::LookupLibrary(url_str));
|
| if (library.IsNull()) {
|
| library = Library::New(url_str);
|
| - library.set_import_map(mapping_array);
|
| + if (mapping_array.IsNull()) {
|
| + library.set_import_map(Array::Handle(Array::Empty()));
|
| + } else {
|
| + library.set_import_map(mapping_array);
|
| + }
|
| library.Register();
|
| } else if (!library.LoadNotStarted()) {
|
| // The source for this library has either been loaded or is in the
|
|
|