| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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/file.h" | 7 #include "bin/file.h" |
| 8 #include "bin/globals.h" | 8 #include "bin/globals.h" |
| 9 | 9 |
| 10 const char* DartUtils::kDartScheme = "dart:"; | 10 const char* DartUtils::kDartScheme = "dart:"; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 } | 30 } |
| 31 } | 31 } |
| 32 } | 32 } |
| 33 return NULL; // Did not find a mapping for this URL. | 33 return NULL; // Did not find a mapping for this URL. |
| 34 } | 34 } |
| 35 | 35 |
| 36 | 36 |
| 37 int64_t DartUtils::GetIntegerValue(Dart_Handle value_obj) { | 37 int64_t DartUtils::GetIntegerValue(Dart_Handle value_obj) { |
| 38 ASSERT(Dart_IsInteger(value_obj)); | 38 ASSERT(Dart_IsInteger(value_obj)); |
| 39 int64_t value = 0; | 39 int64_t value = 0; |
| 40 Dart_Handle result = Dart_IntegerValue(value_obj, &value); | 40 Dart_Handle result = Dart_IntegerToInt64(value_obj, &value); |
| 41 ASSERT(!Dart_IsError(result)); | 41 ASSERT(!Dart_IsError(result)); |
| 42 return value; | 42 return value; |
| 43 } | 43 } |
| 44 | 44 |
| 45 | 45 |
| 46 const char* DartUtils::GetStringValue(Dart_Handle str_obj) { | 46 const char* DartUtils::GetStringValue(Dart_Handle str_obj) { |
| 47 const char* cstring = NULL; | 47 const char* cstring = NULL; |
| 48 Dart_Handle result = Dart_StringToCString(str_obj, &cstring); | 48 Dart_Handle result = Dart_StringToCString(str_obj, &cstring); |
| 49 ASSERT(!Dart_IsError(result)); | 49 ASSERT(!Dart_IsError(result)); |
| 50 return cstring; | 50 return cstring; |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 path, File::PathSeparator(), filename); | 213 path, File::PathSeparator(), filename); |
| 214 | 214 |
| 215 free(path); | 215 free(path); |
| 216 char* canonical_filename = File::GetCanonicalPath(absolute_filename); | 216 char* canonical_filename = File::GetCanonicalPath(absolute_filename); |
| 217 if (canonical_filename == NULL) { | 217 if (canonical_filename == NULL) { |
| 218 return absolute_filename; | 218 return absolute_filename; |
| 219 } | 219 } |
| 220 free(absolute_filename); | 220 free(absolute_filename); |
| 221 return canonical_filename; | 221 return canonical_filename; |
| 222 } | 222 } |
| OLD | NEW |