| 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 NewDartUnsupportedError("Service did not return load port."); | 666 return Dart_NewUnhandledExceptionError( |
| 667 NewDartUnsupportedError("Service did not return load port.")); |
| 667 } | 668 } |
| 668 result = Builtin::SetLoadPort(load_port); | 669 result = Builtin::SetLoadPort(load_port); |
| 669 RETURN_IF_ERROR(result); | 670 RETURN_IF_ERROR(result); |
| 670 } | 671 } |
| 671 | 672 |
| 672 // Set up package root if specified. | 673 // Set up package root if specified. |
| 673 if (package_root != NULL) { | 674 if (package_root != NULL) { |
| 674 ASSERT(package_map == NULL); | 675 ASSERT(package_map == NULL); |
| 675 ASSERT(packages_file == NULL); | 676 ASSERT(packages_file == NULL); |
| 676 result = NewString(package_root); | 677 result = NewString(package_root); |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1271 new CObjectString(CObject::NewString(os_error->message())); | 1272 new CObjectString(CObject::NewString(os_error->message())); |
| 1272 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); | 1273 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); |
| 1273 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); | 1274 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); |
| 1274 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); | 1275 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); |
| 1275 result->SetAt(2, error_message); | 1276 result->SetAt(2, error_message); |
| 1276 return result; | 1277 return result; |
| 1277 } | 1278 } |
| 1278 | 1279 |
| 1279 } // namespace bin | 1280 } // namespace bin |
| 1280 } // namespace dart | 1281 } // namespace dart |
| OLD | NEW |