Re: Gjs Lang.Class uses __proto__ to change function prototypes?
- From: Giovanni Campagna <scampa giovanni gmail com>
- To: Nikita Churaev <lamefun x0r gmail com>
- Cc: "desktop-devel-list gnome org" <desktop-devel-list gnome org>
- Subject: Re: Gjs Lang.Class uses __proto__ to change function prototypes?
- Date: Thu, 18 Apr 2013 21:22:43 +0200
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 have
const 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,
Giovanni
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]