Open vixalien opened 10 months ago
Another idea is automatically converting different datatypes if possible, for easier GLib compatibility. For example, a JS object or a map can be converted to and from a HashMap
instead of forcing the user to do the conversion always manually.
There could be other smart conversions too, like converting a JS Set
to an array, etc..
Another idea is automatically converting different datatypes if possible, for easier GLib compatibility. For example, a JS object or a map can be converted to and from a
HashMap
instead of forcing the user to do the conversion always manually.
Does GJS (or any other bindings) does such thing?
It would be fairly hard to implement that because arguments are not always constants. you have to proxy the original object and apply every changes made to it on the new object.
When setting a property on an object, the bindings assume the correct type was passed. For example, when setting an uint8 property, the bindings assume that a comparable number was given.
It would be better to check the values given before setting properties. Here are some ways this can improve UX and help reduce programmer errors: