Is toDouble missing? #205
Unanswered
fischerscode
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there,
I'm relying on AI to generate code that should then be evaluated, therefore I need
dart_eval
to be quite close to actualdart
. The other day, I got an error thattoDouble
is not working. Back then, I had no really an Idea howdart_eval
works, assumed that I'm doing something wrong, and just multiplied with1.0
instead.Since I hate writing boilerplate and my project requires Wrappers that are not supported by
bindgen
, I'm currently working on my own wrapper builder. (Disclaimer: When I started the project, I missed thatbindgen
exists in the first place.)Now I have a better understanding of how wrappers operate and stumbled over the definition of
$num
and$int
. From what I can tell, they actually don't support most of the common dart features.BridgeClassDef
supported?$num.$getProperty
defined?toDouble
is actually not supported, is it safe toruntime.registerBridgeFunc
a custom$int
wrapper? (Didn't even test if that works, but it seems like the later defined stuff is prioritized.)My current workaround would be the following:
int
.dart_eval
uses.By the way,
dart_eval
seems to be such an unique and powerful project. 👏Edit:
I just found getKnownMethods. Maybe I can inject into the map, or at least this seams to be a starting point for a PR.
Beta Was this translation helpful? Give feedback.
All reactions