| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/bootstrap.h" | 5 #include "vm/bootstrap.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 | 8 |
| 9 #include "vm/bootstrap_natives.h" | 9 #include "vm/bootstrap_natives.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 } | 41 } |
| 42 | 42 |
| 43 | 43 |
| 44 RawScript* Bootstrap::LoadCollectionScript(bool patch) { | 44 RawScript* Bootstrap::LoadCollectionScript(bool patch) { |
| 45 const char* url = patch ? "dart:collection-patch" : "dart:collection"; | 45 const char* url = patch ? "dart:collection-patch" : "dart:collection"; |
| 46 const char* source = patch ? collection_source_ : collection_source_; | 46 const char* source = patch ? collection_source_ : collection_source_; |
| 47 return LoadScript(url, source, patch); | 47 return LoadScript(url, source, patch); |
| 48 } | 48 } |
| 49 | 49 |
| 50 | 50 |
| 51 RawScript* Bootstrap::LoadCollectionDevScript(bool patch) { |
| 52 const char* url = patch ? "dart:collection_dev-patch" : "dart:collection_dev"; |
| 53 const char* source = patch ? collection_dev_source_ : collection_dev_source_; |
| 54 return LoadScript(url, source, patch); |
| 55 } |
| 56 |
| 57 |
| 51 RawScript* Bootstrap::LoadMathScript(bool patch) { | 58 RawScript* Bootstrap::LoadMathScript(bool patch) { |
| 52 const char* url = patch ? "dart:math-patch" : "dart:math"; | 59 const char* url = patch ? "dart:math-patch" : "dart:math"; |
| 53 const char* source = patch ? math_patch_ : math_source_; | 60 const char* source = patch ? math_patch_ : math_source_; |
| 54 return LoadScript(url, source, patch); | 61 return LoadScript(url, source, patch); |
| 55 } | 62 } |
| 56 | 63 |
| 57 | 64 |
| 58 RawScript* Bootstrap::LoadIsolateScript(bool patch) { | 65 RawScript* Bootstrap::LoadIsolateScript(bool patch) { |
| 59 const char* url = patch ? "dart:isolate-patch" : "dart:isolate"; | 66 const char* url = patch ? "dart:isolate-patch" : "dart:isolate"; |
| 60 const char* source = patch ? isolate_patch_ : isolate_source_; | 67 const char* source = patch ? isolate_patch_ : isolate_source_; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 86 const Error& error = Error::Handle(Compiler::Compile(library, script)); | 93 const Error& error = Error::Handle(Compiler::Compile(library, script)); |
| 87 if (error.IsNull()) { | 94 if (error.IsNull()) { |
| 88 library.SetLoaded(); | 95 library.SetLoaded(); |
| 89 } else { | 96 } else { |
| 90 library.SetLoadError(); | 97 library.SetLoadError(); |
| 91 } | 98 } |
| 92 return error.raw(); | 99 return error.raw(); |
| 93 } | 100 } |
| 94 | 101 |
| 95 } // namespace dart | 102 } // namespace dart |
| OLD | NEW |