| 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 "bin/dartutils.h" | 5 #include "bin/dartutils.h" |
| 6 | 6 |
| 7 #include "bin/extensions.h" | 7 #include "bin/extensions.h" |
| 8 #include "bin/directory.h" | 8 #include "bin/directory.h" |
| 9 #include "bin/file.h" | 9 #include "bin/file.h" |
| 10 #include "bin/io_buffer.h" | 10 #include "bin/io_buffer.h" |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 Dart_Handle builtin_lib) { | 342 Dart_Handle builtin_lib) { |
| 343 Dart_Handle resolved_script_uri; | 343 Dart_Handle resolved_script_uri; |
| 344 resolved_script_uri = ResolveScriptUri(NewString(script_uri), builtin_lib); | 344 resolved_script_uri = ResolveScriptUri(NewString(script_uri), builtin_lib); |
| 345 if (Dart_IsError(resolved_script_uri)) { | 345 if (Dart_IsError(resolved_script_uri)) { |
| 346 return resolved_script_uri; | 346 return resolved_script_uri; |
| 347 } | 347 } |
| 348 Dart_Handle source = ReadSource(resolved_script_uri, builtin_lib); | 348 Dart_Handle source = ReadSource(resolved_script_uri, builtin_lib); |
| 349 if (Dart_IsError(source)) { | 349 if (Dart_IsError(source)) { |
| 350 return source; | 350 return source; |
| 351 } | 351 } |
| 352 return Dart_LoadEmbeddedScript(resolved_script_uri, source, 0, 0); | 352 return Dart_LoadScript(resolved_script_uri, source, 0, 0); |
| 353 } | 353 } |
| 354 | 354 |
| 355 | 355 |
| 356 Dart_Handle DartUtils::LoadSource(CommandLineOptions* url_mapping, | 356 Dart_Handle DartUtils::LoadSource(CommandLineOptions* url_mapping, |
| 357 Dart_Handle library, | 357 Dart_Handle library, |
| 358 Dart_Handle url, | 358 Dart_Handle url, |
| 359 Dart_LibraryTag tag, | 359 Dart_LibraryTag tag, |
| 360 const char* url_string) { | 360 const char* url_string) { |
| 361 if (url_mapping != NULL && IsDartSchemeURL(url_string)) { | 361 if (url_mapping != NULL && IsDartSchemeURL(url_string)) { |
| 362 const char* mapped_url_string = MapLibraryUrl(url_mapping, url_string); | 362 const char* mapped_url_string = MapLibraryUrl(url_mapping, url_string); |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 | 694 |
| 695 CObject* CObject::NewOSError(OSError* os_error) { | 695 CObject* CObject::NewOSError(OSError* os_error) { |
| 696 CObject* error_message = | 696 CObject* error_message = |
| 697 new CObjectString(CObject::NewString(os_error->message())); | 697 new CObjectString(CObject::NewString(os_error->message())); |
| 698 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); | 698 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); |
| 699 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); | 699 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); |
| 700 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); | 700 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); |
| 701 result->SetAt(2, error_message); | 701 result->SetAt(2, error_message); |
| 702 return result; | 702 return result; |
| 703 } | 703 } |
| OLD | NEW |