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 const char* DartUtils::kBuiltinLibURL = "./dart:builtin-lib"; | 7 const char* DartUtils::kBuiltinLibURL = "dart:builtin-lib"; |
Anton Muhin
2011/11/13 16:19:32
up to you, but IMHO we have too many styles of bui
siva
2011/11/15 02:16:52
I have standardized to use dash separated names.
R
| |
8 const char* DartUtils::kCoreLibURL = "dart:core"; | |
9 const char* DartUtils::kCoreImplLibURL = "dart:coreimpl"; | |
10 const char* DartUtils::kCoreNativeFieldsLibURL = "dart:core_native_fields"; | |
8 const char* DartUtils::kBuiltinLibSpec = "library { }"; | 11 const char* DartUtils::kBuiltinLibSpec = "library { }"; |
9 const char* DartUtils::kIdFieldName = "_id"; | 12 const char* DartUtils::kIdFieldName = "_id"; |
10 | 13 |
11 | |
12 int64_t DartUtils::GetIntegerValue(Dart_Handle value_obj) { | 14 int64_t DartUtils::GetIntegerValue(Dart_Handle value_obj) { |
13 ASSERT(Dart_IsInteger(value_obj)); | 15 ASSERT(Dart_IsInteger(value_obj)); |
14 int64_t value = 0; | 16 int64_t value = 0; |
15 Dart_Handle result = Dart_IntegerValue(value_obj, &value); | 17 Dart_Handle result = Dart_IntegerValue(value_obj, &value); |
16 ASSERT(Dart_IsValid(result)); | 18 ASSERT(Dart_IsValid(result)); |
17 return value; | 19 return value; |
18 } | 20 } |
19 | 21 |
20 const char* DartUtils::GetStringValue(Dart_Handle str_obj) { | 22 const char* DartUtils::GetStringValue(Dart_Handle str_obj) { |
21 const char* cstring = NULL; | 23 const char* cstring = NULL; |
(...skipping 29 matching lines...) Expand all Loading... | |
51 } | 53 } |
52 | 54 |
53 void DartUtils::SetStringInstanceField(Dart_Handle handle, | 55 void DartUtils::SetStringInstanceField(Dart_Handle handle, |
54 const char* name, | 56 const char* name, |
55 const char* val) { | 57 const char* val) { |
56 Dart_Handle result = Dart_SetInstanceField(handle, | 58 Dart_Handle result = Dart_SetInstanceField(handle, |
57 Dart_NewString(name), | 59 Dart_NewString(name), |
58 Dart_NewString(val)); | 60 Dart_NewString(val)); |
59 ASSERT(Dart_IsValid(result)); | 61 ASSERT(Dart_IsValid(result)); |
60 } | 62 } |
OLD | NEW |