| 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 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 result = Dart_SetField(builtin_lib, | 677 result = Dart_SetField(builtin_lib, |
| 678 NewString("_traceLoading"), Dart_True()); | 678 NewString("_traceLoading"), Dart_True()); |
| 679 RETURN_IF_ERROR(result); | 679 RETURN_IF_ERROR(result); |
| 680 } | 680 } |
| 681 // Set current working directory. | 681 // Set current working directory. |
| 682 result = SetWorkingDirectory(builtin_lib); | 682 result = SetWorkingDirectory(builtin_lib); |
| 683 RETURN_IF_ERROR(result); | 683 RETURN_IF_ERROR(result); |
| 684 // Wait for the service isolate to initialize the load port. | 684 // Wait for the service isolate to initialize the load port. |
| 685 Dart_Port load_port = Dart_ServiceWaitForLoadPort(); | 685 Dart_Port load_port = Dart_ServiceWaitForLoadPort(); |
| 686 if (load_port == ILLEGAL_PORT) { | 686 if (load_port == ILLEGAL_PORT) { |
| 687 // TODO(rmacnak): Return an error handle here once precompilation_test | 687 return Dart_NewUnhandledExceptionError( |
| 688 // works. | 688 NewDartUnsupportedError("Service did not return load port.")); |
| 689 return NewDartUnsupportedError("Service did not return load port."); | |
| 690 } | 689 } |
| 691 result = Builtin::SetLoadPort(load_port); | 690 result = Builtin::SetLoadPort(load_port); |
| 692 RETURN_IF_ERROR(result); | 691 RETURN_IF_ERROR(result); |
| 693 } | 692 } |
| 694 | 693 |
| 695 // Set up package root if specified. | 694 // Set up package root if specified. |
| 696 if (package_root != NULL) { | 695 if (package_root != NULL) { |
| 697 ASSERT(package_map == NULL); | 696 ASSERT(package_map == NULL); |
| 698 ASSERT(packages_file == NULL); | 697 ASSERT(packages_file == NULL); |
| 699 result = NewString(package_root); | 698 result = NewString(package_root); |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1294 new CObjectString(CObject::NewString(os_error->message())); | 1293 new CObjectString(CObject::NewString(os_error->message())); |
| 1295 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); | 1294 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); |
| 1296 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); | 1295 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); |
| 1297 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); | 1296 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); |
| 1298 result->SetAt(2, error_message); | 1297 result->SetAt(2, error_message); |
| 1299 return result; | 1298 return result; |
| 1300 } | 1299 } |
| 1301 | 1300 |
| 1302 } // namespace bin | 1301 } // namespace bin |
| 1303 } // namespace dart | 1302 } // namespace dart |
| OLD | NEW |