Note that while it's non-standard, every browser supports it, because it's
part of the "Web ECMAScript" standard.

http://javascript.spec.whatwg.org/#object.prototype.__proto__



On Thu, Apr 18, 2013 at 3:22 PM, Giovanni Campagna <
[email protected]> wrote:

> 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
>
>
> 2013/4/18 Nikita Churaev <[email protected]>
>
>> 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
>> [email protected]
>> https://mail.gnome.org/mailman/listinfo/desktop-devel-list
>>
>
>
> _______________________________________________
> desktop-devel-list mailing list
> [email protected]
> https://mail.gnome.org/mailman/listinfo/desktop-devel-list
>



-- 
  Jasper
_______________________________________________
desktop-devel-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/desktop-devel-list

Reply via email to