| 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_native_api.h" | 8 #include "include/dart_native_api.h" |
| 9 | 9 |
| 10 #include "platform/assert.h" | 10 #include "platform/assert.h" |
| (...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 837 message, | 837 message, |
| 838 os_error); | 838 os_error); |
| 839 } | 839 } |
| 840 | 840 |
| 841 | 841 |
| 842 Dart_Handle DartUtils::NewInternalError(const char* message) { | 842 Dart_Handle DartUtils::NewInternalError(const char* message) { |
| 843 return NewDartExceptionWithMessage(kCoreLibURL, "_InternalError", message); | 843 return NewDartExceptionWithMessage(kCoreLibURL, "_InternalError", message); |
| 844 } | 844 } |
| 845 | 845 |
| 846 | 846 |
| 847 void DartUtils::SetOriginalWorkingDirectory() { | 847 bool DartUtils::SetOriginalWorkingDirectory() { |
| 848 original_working_directory = Directory::Current(); | 848 original_working_directory = Directory::Current(); |
| 849 return original_working_directory != NULL; |
| 849 } | 850 } |
| 850 | 851 |
| 851 | 852 |
| 852 // Statically allocated Dart_CObject instances for immutable | 853 // Statically allocated Dart_CObject instances for immutable |
| 853 // objects. As these will be used by different threads the use of | 854 // objects. As these will be used by different threads the use of |
| 854 // these depends on the fact that the marking internally in the | 855 // these depends on the fact that the marking internally in the |
| 855 // Dart_CObject structure is not marking simple value objects. | 856 // Dart_CObject structure is not marking simple value objects. |
| 856 Dart_CObject CObject::api_null_ = { Dart_CObject_kNull , { 0 } }; | 857 Dart_CObject CObject::api_null_ = { Dart_CObject_kNull , { 0 } }; |
| 857 Dart_CObject CObject::api_true_ = { Dart_CObject_kBool , { true } }; | 858 Dart_CObject CObject::api_true_ = { Dart_CObject_kBool , { true } }; |
| 858 Dart_CObject CObject::api_false_ = { Dart_CObject_kBool, { false } }; | 859 Dart_CObject CObject::api_false_ = { Dart_CObject_kBool, { false } }; |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1011 new CObjectString(CObject::NewString(os_error->message())); | 1012 new CObjectString(CObject::NewString(os_error->message())); |
| 1012 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); | 1013 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); |
| 1013 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); | 1014 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); |
| 1014 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); | 1015 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); |
| 1015 result->SetAt(2, error_message); | 1016 result->SetAt(2, error_message); |
| 1016 return result; | 1017 return result; |
| 1017 } | 1018 } |
| 1018 | 1019 |
| 1019 } // namespace bin | 1020 } // namespace bin |
| 1020 } // namespace dart | 1021 } // namespace dart |
| OLD | NEW |