| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 // Generate a snapshot file after loading all the scripts specified on the | 5 // Generate a snapshot file after loading all the scripts specified on the |
| 6 // command line. | 6 // command line. |
| 7 | 7 |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 return url; | 328 return url; |
| 329 } | 329 } |
| 330 // Parts of internal libraries are handled internally. | 330 // Parts of internal libraries are handled internally. |
| 331 if (libraryBuiltinId != Builtin::kInvalidLibrary) { | 331 if (libraryBuiltinId != Builtin::kInvalidLibrary) { |
| 332 return url; | 332 return url; |
| 333 } | 333 } |
| 334 return ResolveUri(library_url_string, url_string); | 334 return ResolveUri(library_url_string, url_string); |
| 335 } | 335 } |
| 336 | 336 |
| 337 Builtin::BuiltinLibraryId builtinId = BuiltinId(url_string); | 337 Builtin::BuiltinLibraryId builtinId = BuiltinId(url_string); |
| 338 if (builtinId != Builtin::kInvalidLibrary) { | 338 if ((builtinId != Builtin::kInvalidLibrary) && (mapped_url_string == NULL)) { |
| 339 // Special case for importing a builtin library. | 339 // Special case for importing a builtin library that isn't remapped. |
| 340 if (tag == Dart_kImportTag) { | 340 if (tag == Dart_kImportTag) { |
| 341 return Builtin::LoadLibrary(url, builtinId); | 341 return Builtin::LoadLibrary(url, builtinId); |
| 342 } | 342 } |
| 343 ASSERT(tag == Dart_kSourceTag); | 343 ASSERT(tag == Dart_kSourceTag); |
| 344 return DartUtils::NewError("Unable to part '%s' ", url_string); | 344 return DartUtils::NewError("Unable to part '%s' ", url_string); |
| 345 } | 345 } |
| 346 | 346 |
| 347 if (libraryBuiltinId != Builtin::kInvalidLibrary) { | 347 if (libraryBuiltinId != Builtin::kInvalidLibrary) { |
| 348 // Special case for parting sources of a builtin library. | 348 // Special case for parting sources of a builtin library. |
| 349 if (tag == Dart_kSourceTag) { | 349 if (tag == Dart_kSourceTag) { |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 } | 630 } |
| 631 return 0; | 631 return 0; |
| 632 } | 632 } |
| 633 | 633 |
| 634 } // namespace bin | 634 } // namespace bin |
| 635 } // namespace dart | 635 } // namespace dart |
| 636 | 636 |
| 637 int main(int argc, char** argv) { | 637 int main(int argc, char** argv) { |
| 638 return dart::bin::main(argc, argv); | 638 return dart::bin::main(argc, argv); |
| 639 } | 639 } |
| OLD | NEW |