| Index: runtime/vm/object.cc
|
| ===================================================================
|
| --- runtime/vm/object.cc (revision 18956)
|
| +++ runtime/vm/object.cc (working copy)
|
| @@ -1094,6 +1094,22 @@
|
| if (!error.IsNull()) {
|
| return error.raw();
|
| }
|
| +
|
| + Library::InitTypedDataLibrary(isolate);
|
| + Library& typeddata_lib = Library::Handle(Library::TypedDataLibrary());
|
| + ASSERT(!typeddata_lib.IsNull());
|
| + const Script& typeddata_script = Script::Handle(
|
| + Bootstrap::LoadTypedDataScript(false));
|
| + error = Bootstrap::Compile(typeddata_lib, typeddata_script);
|
| + if (!error.IsNull()) {
|
| + return error.raw();
|
| + }
|
| + patch_script = Bootstrap::LoadTypedDataScript(true);
|
| + error = typeddata_lib.Patch(patch_script);
|
| + if (!error.IsNull()) {
|
| + return error.raw();
|
| + }
|
| +
|
| Library& lib = Library::Handle();
|
| INIT_LIBRARY(Crypto,
|
| Bootstrap::LoadCryptoScript(false),
|
| @@ -6510,6 +6526,28 @@
|
| }
|
|
|
|
|
| +void Library::InitTypedDataLibrary(Isolate* isolate) {
|
| + const Array& null_array = Array::Handle();
|
| + Library& import_lib = Library::Handle();
|
| + Namespace& import_ns = Namespace::Handle();
|
| + const String& url = Symbols::DartTypedData();
|
| + const Library& lib = Library::Handle(Library::NewLibraryHelper(url, true));
|
| + lib.Register();
|
| +
|
| + import_lib = Library::CollectionLibrary();
|
| + import_ns = Namespace::New(import_lib, null_array, null_array);
|
| + lib.AddImport(import_ns);
|
| +
|
| + const String& import_prefix = String::Handle(Symbols::New("sl"));
|
| + import_lib = Library::ScalarlistLibrary();
|
| + import_ns = Namespace::New(import_lib, null_array, null_array);
|
| + const LibraryPrefix& library_prefix = LibraryPrefix::Handle(
|
| + LibraryPrefix::New(import_prefix, import_ns));
|
| + lib.AddObject(library_prefix, import_prefix);
|
| + isolate->object_store()->set_typeddata_library(lib);
|
| +}
|
| +
|
| +
|
| void Library::InitUriLibrary(Isolate* isolate) {
|
| const String& url = Symbols::DartUri();
|
| const Library& lib = Library::Handle(Library::NewLibraryHelper(url, true));
|
| @@ -6686,6 +6724,11 @@
|
| }
|
|
|
|
|
| +RawLibrary* Library::TypedDataLibrary() {
|
| + return Isolate::Current()->object_store()->typeddata_library();
|
| +}
|
| +
|
| +
|
| RawLibrary* Library::UriLibrary() {
|
| return Isolate::Current()->object_store()->uri_library();
|
| }
|
|
|