| 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 "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "include/dart_tools_api.h" | 8 #include "include/dart_tools_api.h" |
| 9 #include "include/dart_native_api.h" | 9 #include "include/dart_native_api.h" |
| 10 | 10 |
| (...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 result = Dart_SetField(builtin_lib, | 656 result = Dart_SetField(builtin_lib, |
| 657 NewString("_traceLoading"), Dart_True()); | 657 NewString("_traceLoading"), Dart_True()); |
| 658 RETURN_IF_ERROR(result); | 658 RETURN_IF_ERROR(result); |
| 659 } | 659 } |
| 660 // Set current working directory. | 660 // Set current working directory. |
| 661 result = SetWorkingDirectory(builtin_lib); | 661 result = SetWorkingDirectory(builtin_lib); |
| 662 RETURN_IF_ERROR(result); | 662 RETURN_IF_ERROR(result); |
| 663 // Wait for the service isolate to initialize the load port. | 663 // Wait for the service isolate to initialize the load port. |
| 664 Dart_Port load_port = Dart_ServiceWaitForLoadPort(); | 664 Dart_Port load_port = Dart_ServiceWaitForLoadPort(); |
| 665 if (load_port == ILLEGAL_PORT) { | 665 if (load_port == ILLEGAL_PORT) { |
| 666 return Dart_NewUnhandledExceptionError( | 666 // TODO(rmacnak): Return an error handle here once precompilation_test |
| 667 NewDartUnsupportedError("Service did not return load port.")); | 667 // works. |
| 668 return NewDartUnsupportedError("Service did not return load port."); |
| 668 } | 669 } |
| 669 result = Builtin::SetLoadPort(load_port); | 670 result = Builtin::SetLoadPort(load_port); |
| 670 RETURN_IF_ERROR(result); | 671 RETURN_IF_ERROR(result); |
| 671 } | 672 } |
| 672 | 673 |
| 673 // Set up package root if specified. | 674 // Set up package root if specified. |
| 674 if (package_root != NULL) { | 675 if (package_root != NULL) { |
| 675 ASSERT(package_map == NULL); | 676 ASSERT(package_map == NULL); |
| 676 ASSERT(packages_file == NULL); | 677 ASSERT(packages_file == NULL); |
| 677 result = NewString(package_root); | 678 result = NewString(package_root); |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1272 new CObjectString(CObject::NewString(os_error->message())); | 1273 new CObjectString(CObject::NewString(os_error->message())); |
| 1273 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); | 1274 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); |
| 1274 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); | 1275 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); |
| 1275 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); | 1276 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); |
| 1276 result->SetAt(2, error_message); | 1277 result->SetAt(2, error_message); |
| 1277 return result; | 1278 return result; |
| 1278 } | 1279 } |
| 1279 | 1280 |
| 1280 } // namespace bin | 1281 } // namespace bin |
| 1281 } // namespace dart | 1282 } // namespace dart |
| OLD | NEW |