| 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/crypto.h" | 7 #include "bin/crypto.h" |
| 8 #include "bin/directory.h" | 8 #include "bin/directory.h" |
| 9 #include "bin/extensions.h" | 9 #include "bin/extensions.h" |
| 10 #include "bin/file.h" | 10 #include "bin/file.h" |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 | 328 |
| 329 Dart_Handle DartUtils::SetWorkingDirectory() { | 329 Dart_Handle DartUtils::SetWorkingDirectory() { |
| 330 IsolateData* isolate_data = | 330 IsolateData* isolate_data = |
| 331 reinterpret_cast<IsolateData*>(Dart_CurrentIsolateData()); | 331 reinterpret_cast<IsolateData*>(Dart_CurrentIsolateData()); |
| 332 Dart_Handle builtin_lib = isolate_data->builtin_lib(); | 332 Dart_Handle builtin_lib = isolate_data->builtin_lib(); |
| 333 Dart_Handle directory = NewString(original_working_directory); | 333 Dart_Handle directory = NewString(original_working_directory); |
| 334 return SingleArgDart_Invoke(builtin_lib, "_setWorkingDirectory", directory); | 334 return SingleArgDart_Invoke(builtin_lib, "_setWorkingDirectory", directory); |
| 335 } | 335 } |
| 336 | 336 |
| 337 | 337 |
| 338 Dart_Handle DartUtils::ResolveUriInWorkingDirectory(Dart_Handle script_uri) { |
| 339 const int kNumArgs = 1; |
| 340 Dart_Handle dart_args[kNumArgs]; |
| 341 dart_args[0] = script_uri; |
| 342 return Dart_Invoke(DartUtils::BuiltinLib(), |
| 343 NewString("_resolveInWorkingDirectory"), |
| 344 kNumArgs, |
| 345 dart_args); |
| 346 } |
| 347 |
| 348 |
| 338 Dart_Handle DartUtils::LibraryFilePath(Dart_Handle library_uri) { | 349 Dart_Handle DartUtils::LibraryFilePath(Dart_Handle library_uri) { |
| 339 const int kNumArgs = 1; | 350 const int kNumArgs = 1; |
| 340 Dart_Handle dart_args[kNumArgs]; | 351 Dart_Handle dart_args[kNumArgs]; |
| 341 dart_args[0] = library_uri; | 352 dart_args[0] = library_uri; |
| 342 return Dart_Invoke(DartUtils::BuiltinLib(), | 353 return Dart_Invoke(DartUtils::BuiltinLib(), |
| 343 NewString("_libraryFilePath"), | 354 NewString("_libraryFilePath"), |
| 344 kNumArgs, | 355 kNumArgs, |
| 345 dart_args); | 356 dart_args); |
| 346 } | 357 } |
| 347 | 358 |
| (...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1249 new CObjectString(CObject::NewString(os_error->message())); | 1260 new CObjectString(CObject::NewString(os_error->message())); |
| 1250 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); | 1261 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); |
| 1251 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); | 1262 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); |
| 1252 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); | 1263 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); |
| 1253 result->SetAt(2, error_message); | 1264 result->SetAt(2, error_message); |
| 1254 return result; | 1265 return result; |
| 1255 } | 1266 } |
| 1256 | 1267 |
| 1257 } // namespace bin | 1268 } // namespace bin |
| 1258 } // namespace dart | 1269 } // namespace dart |
| OLD | NEW |