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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 if (tag == Dart_kImportTag) { | 321 if (tag == Dart_kImportTag) { |
322 return Builtin::LoadAndCheckLibrary(builtinId); | 322 return Builtin::LoadAndCheckLibrary(builtinId); |
323 } | 323 } |
324 ASSERT(tag == Dart_kSourceTag); | 324 ASSERT(tag == Dart_kSourceTag); |
325 return DartUtils::NewError("Unable to part '%s' ", url_string); | 325 return DartUtils::NewError("Unable to part '%s' ", url_string); |
326 } | 326 } |
327 | 327 |
328 if (libraryBuiltinId != Builtin::kInvalidLibrary) { | 328 if (libraryBuiltinId != Builtin::kInvalidLibrary) { |
329 // Special case for parting sources of a builtin library. | 329 // Special case for parting sources of a builtin library. |
330 if (tag == Dart_kSourceTag) { | 330 if (tag == Dart_kSourceTag) { |
331 return Dart_LoadSource( | 331 return Dart_LoadSource(library, url, |
332 library, url, Builtin::PartSource(libraryBuiltinId, url_string)); | 332 Builtin::PartSource(libraryBuiltinId, url_string), 0, 0); |
333 } | 333 } |
334 ASSERT(tag == Dart_kImportTag); | 334 ASSERT(tag == Dart_kImportTag); |
335 return DartUtils::NewError("Unable to import '%s' ", url_string); | 335 return DartUtils::NewError("Unable to import '%s' ", url_string); |
336 } | 336 } |
337 | 337 |
338 Dart_Handle resolved_url = url; | 338 Dart_Handle resolved_url = url; |
339 if (mapped_url_string != NULL) { | 339 if (mapped_url_string != NULL) { |
340 // Mapped urls are relative to working directory. | 340 // Mapped urls are relative to working directory. |
341 resolved_url = ResolveScriptUri(mapped_url_string); | 341 resolved_url = ResolveScriptUri(mapped_url_string); |
342 if (Dart_IsError(resolved_url)) { | 342 if (Dart_IsError(resolved_url)) { |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 } | 581 } |
582 return 0; | 582 return 0; |
583 } | 583 } |
584 | 584 |
585 } // namespace bin | 585 } // namespace bin |
586 } // namespace dart | 586 } // namespace dart |
587 | 587 |
588 int main(int argc, char** argv) { | 588 int main(int argc, char** argv) { |
589 return dart::bin::main(argc, argv); | 589 return dart::bin::main(argc, argv); |
590 } | 590 } |
OLD | NEW |