Dart API merge IntegerFitsInto... and IntegerTo... #2748
Labels
area-vm
Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends.
type-enhancement
A request for a change that isn't a bug
When using the API to get an integer from a Dart integer object, we need to call two api functions, and check two error conditions and a boolean return, to get the integer value.
It seems quite unlikely to me that one would want to check whether a Dart integer fits into int64_t, but not also get that value if the answer is yes.
So I think that a combined
Dart_IntegerToInt64(Dart_Handle integer, int64_t* value, bool* fits)
returning both the value, if it fits, and a boolean saying if the value fits
would be easier to use.
The text was updated successfully, but these errors were encountered: