Re: GJS Warnings even on GJS_DISABLE_EXTRA_WARNINGS=1



they really really don't want you mutating the prototype of an object. It must really be that slow.

It's part of standard specifications and it's cheaper than any other workaround that would avoid using `Object.setPrototypeOf`, including a Proxy.

They really should mind their business, or complain with TC39 instead, IMO.

As summary, should I blame Mozilla and file a bug there?

Thanks

On Fri, Apr 14, 2017 at 4:32 AM, <philip chimento gmail com> wrote:
On Thu, Apr 13, 2017, 11:23 Andrea Giammarchi <andrea giammarchi gmail com> wrote:
Apparently, the latest GJS warns about "stuff" even if executed through GJS_DISABLE_EXTRA_WARNINGS=1 flag.

Gjs-Message: JS WARNING: [/app/lib/jsgtk/jsgtk_modules/jsgtk/babel.js 26]: mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create

This message is completely useless/pointless when it comes to transpiled code, and to be honest, it's been always useless on Firefox consoles too 'cause developers setting or mutating a prototype 99% of the time have valid reasons to do so.

Am I missing yet another flag to ask GJS to kindly "shut-up" or any attempt to normalize Gir classes as JS will show these kind of warnings?

Thanks for any sort of explanation/hint about this.

Hi Andrea,

It's true, this warning is not affected by the disable-extra-warnings setting. I don't have an explanation why the Firefox devs chose to make it that way, except maybe they really really don't want you mutating the prototype of an object. It must really be that slow.

You could try to use an ES6 Proxy to achieve what you want.

Regards,
Philip C



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]