dart-lang / native

Dart packages related to FFI and native assets bundling.
BSD 3-Clause "New" or "Revised" License
94 stars 33 forks source link

Object utility methods #639

Open mahesh-hegde opened 1 year ago

mahesh-hegde commented 1 year ago

JNI API provides few useful methods related to class and objects equality. It would be nice to have higher-level wrappers for them working on JObject subclasses.

HosseinYousefi commented 1 year ago

IsSameObject - should we overload == to call IsSameObject from JNI? (Different ref values can point to same object).

isSameObject can be its own method. In the branch I'm currently working on, I decided to overload == to call equals as I think this is idiomatic in Dart.


obj.isInstanceOf(ClassName.type)

I like this.