Re: GSJ GIRepository VS Seed
- From: Andrea Giammarchi <andrea giammarchi gmail com>
- To: Emmanuele Bassi <ebassi gmail com>
- Cc: Alan Knowles <alan roojs com>, javascript-list <javascript-list gnome org>
- Subject: Re: GSJ GIRepository VS Seed
- Date: Tue, 22 Mar 2016 11:59:22 +0000
As far as I understand this is probably a GJS limitation but please let's not assume I don't know what I am doing 'cause that sounds just arrogant, thanks.
To quickly explain: in JS inheritance is prototypal and enriching a prototype makes its method available to every derived instance.
There's nothing wrong in this mechanism in the JS world, so nothing is broken or badly designed, that's just how it is in JS (debatable if JS is badly designed but I'm not here to discuss this).
On top of that you wrote "GLocalFile has no public API, and you're supposed to only use the GFile methods"
Now you told me this class is internal for reasons and could change ... so, which one is true: I have to assume it's a GFile but I cannot theoretically trust methods in the GFile interface/prototype ? ... or my expectations are correct, in a JS environment context, where I should be able to trust interfaces and/or/as prototypes and these are extensible and all derived/"is-a" instances should rightly inherits these methods?
I see no solution thought so I'll ended up with a configurable `__noSuchMethod__` in the `GObject.Object.prototype` which is inherited and this just works but since there is a namespace to introspect I was hoping to be able to introspect everything regardless how bad design it is (you should probably also have asked why I am doing that or what's the goal)
Best Regards
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]