| 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 <stdlib.h> | 5 #include <stdlib.h> |
| 6 #include <string.h> | 6 #include <string.h> |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include "include/dart_api.h" | 9 #include "include/dart_api.h" |
| 10 #include "include/dart_debugger_api.h" | 10 #include "include/dart_debugger_api.h" |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 } | 271 } |
| 272 if (is_dart_scheme_url) { | 272 if (is_dart_scheme_url) { |
| 273 ASSERT(tag == kImportTag); | 273 ASSERT(tag == kImportTag); |
| 274 // Handle imports of other built-in libraries present in the SDK. | 274 // Handle imports of other built-in libraries present in the SDK. |
| 275 if (DartUtils::IsDartIOLibURL(url_string)) { | 275 if (DartUtils::IsDartIOLibURL(url_string)) { |
| 276 return Builtin::LoadLibrary(Builtin::kIOLibrary); | 276 return Builtin::LoadLibrary(Builtin::kIOLibrary); |
| 277 } else if (DartUtils::IsDartJsonLibURL(url_string)) { | 277 } else if (DartUtils::IsDartJsonLibURL(url_string)) { |
| 278 return Builtin::LoadLibrary(Builtin::kJsonLibrary); | 278 return Builtin::LoadLibrary(Builtin::kJsonLibrary); |
| 279 } else if (DartUtils::IsDartUriLibURL(url_string)) { | 279 } else if (DartUtils::IsDartUriLibURL(url_string)) { |
| 280 return Builtin::LoadLibrary(Builtin::kUriLibrary); | 280 return Builtin::LoadLibrary(Builtin::kUriLibrary); |
| 281 } else if (DartUtils::IsDartUtf8LibURL(url_string)) { | 281 } else if (DartUtils::IsDartUtfLibURL(url_string)) { |
| 282 return Builtin::LoadLibrary(Builtin::kUtf8Library); | 282 return Builtin::LoadLibrary(Builtin::kUtfLibrary); |
| 283 } else { | 283 } else { |
| 284 return Dart_Error("Do not know how to load '%s'", url_string); | 284 return Dart_Error("Do not know how to load '%s'", url_string); |
| 285 } | 285 } |
| 286 } else if (is_dart_extension_url) { | 286 } else if (is_dart_extension_url) { |
| 287 if (tag != kImportTag) { | 287 if (tag != kImportTag) { |
| 288 return Dart_Error("Dart extensions must use import: '%s'", url_string); | 288 return Dart_Error("Dart extensions must use import: '%s'", url_string); |
| 289 } | 289 } |
| 290 return Extensions::LoadExtension(url_string, library); | 290 return Extensions::LoadExtension(url_string, library); |
| 291 } else { | 291 } else { |
| 292 // Get the file path out of the url. | 292 // Get the file path out of the url. |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 EventHandler::Terminate(); | 603 EventHandler::Terminate(); |
| 604 // Terminate process exit-code handler. | 604 // Terminate process exit-code handler. |
| 605 Process::TerminateExitCodeHandler(); | 605 Process::TerminateExitCodeHandler(); |
| 606 | 606 |
| 607 free(const_cast<char*>(original_script_name)); | 607 free(const_cast<char*>(original_script_name)); |
| 608 free(const_cast<char*>(original_working_directory)); | 608 free(const_cast<char*>(original_working_directory)); |
| 609 free(const_cast<char*>(original_script_url)); | 609 free(const_cast<char*>(original_script_url)); |
| 610 | 610 |
| 611 return 0; | 611 return 0; |
| 612 } | 612 } |
| OLD | NEW |