| Index: sky/engine/tonic/dart_converter.h
|
| diff --git a/sky/engine/tonic/dart_converter.h b/sky/engine/tonic/dart_converter.h
|
| index 055a82b7efa3e5f1203147a6245cda59570658f3..b27c8b8952921c385df3bea79594b5b8d18a2801 100644
|
| --- a/sky/engine/tonic/dart_converter.h
|
| +++ b/sky/engine/tonic/dart_converter.h
|
| @@ -77,7 +77,7 @@ struct DartConverterInteger {
|
| static T FromDart(Dart_Handle handle) {
|
| int64_t result = 0;
|
| Dart_IntegerToInt64(handle, &result);
|
| - return result;
|
| + return static_cast<T>(result);
|
| }
|
|
|
| static T FromArguments(Dart_NativeArguments args,
|
| @@ -85,7 +85,7 @@ struct DartConverterInteger {
|
| Dart_Handle& exception) {
|
| int64_t result = 0;
|
| Dart_GetNativeIntegerArgument(args, index, &result);
|
| - return result;
|
| + return static_cast<T>(result);
|
| }
|
| };
|
|
|
| @@ -159,6 +159,24 @@ template <>
|
| struct DartConverter<double> : public DartConverterFloatingPoint<double> {};
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| +// Enums
|
| +
|
| +template <typename T>
|
| +struct DartConverterEnum {
|
| + static T FromArguments(Dart_NativeArguments args,
|
| + int index,
|
| + Dart_Handle& exception) {
|
| + Dart_Handle enum_handle = Dart_GetNativeArgument(args, index);
|
| + Dart_Handle index_handle =
|
| + Dart_GetField(enum_handle, DartState::Current()->index_handle());
|
| +
|
| + uint64_t enum_index = 0;
|
| + Dart_IntegerToUint64(index_handle, &enum_index);
|
| + return static_cast<T>(enum_index);
|
| + }
|
| +};
|
| +
|
| +////////////////////////////////////////////////////////////////////////////////
|
| // Strings
|
|
|
| template <>
|
|
|