Yes, this is non standard, but it's supported by SpiderMonkey, and that's what gjs uses.It's an implementation detail anyway, and its purpose is to have callable objects whose prototype is not Function.prototype, so that you can haveconst MyClass = new Lang.Class(...);and "MyClass instanceof Lang.Class" becomes true, even though MyClass is a constructor (function).In any case, this kind of question is better asked in a specific mailing list, such as gnome-shell-list (most gjs devs are there) or _javascript_-list. Alternatively, you can find us in IRC (#introspection, #gnome-shell or #gnome-hackers).Cheers,Giovanni2013/4/18 Nikita Churaev <lamefun x0r gmail com>
I've stumbled upon this while reading lang.js:
newClass.__proto__ = this.constructor.prototype;
where newClass is a function. Why does Gjs do this? Isn't this
non-standard?
_______________________________________________
desktop-devel-list mailing list
desktop-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/desktop-devel-list
_______________________________________________
desktop-devel-list mailing list
desktop-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/desktop-devel-list