NativeScript / android

NativeScript for Android using v8
https://docs.nativescript.org/guide/android-marshalling
Apache License 2.0
523 stars 134 forks source link

feat: Java methods returning java.lang primitive #1710

Open farfromrefug opened 2 years ago

farfromrefug commented 2 years ago

converted to JS corresponding type. This is an issue which always bugged me on difference between Float/Integer/Double/Long and basic float/int/long... handling

This is kind of a breaking change since JS codes doing floatValue() before wont work anymore and will crash. We have a few in N core for which i ll create a PR

triniwiz commented 1 year ago

We can look this for the next major release

farfromrefug commented 11 months ago

@triniwiz @NathanWalker can we consider this one now (needs to be updated though)? I am facing this again while implementing a new plugin where i have to pass new java.lang.Integer(value) which seems really unecessary. Also it is slower than handling it on the runtime side

farfromrefug commented 2 months ago

@triniwiz in this PR i handle callback return result type. And i see it is tricky as it is a breaking change. Now i am facing the issue of java apis which sometimes takes a boolean as parameter and sometimes a java.lang.Boolean. I really would like the runtime to handle that automatically from a JS boolean. Do you see where this would be happening? I am ok implementing it but i dont see where it would be done

triniwiz commented 2 months ago

@farfromrefug in the converter when building the args we can try converting primitives to the objects.