Re: GJS Warnings even on GJS_DISABLE_EXTRA_WARNINGS=1



On Fri, Apr 14, 2017 at 5:13 AM Andrea Giammarchi <andrea giammarchi gmail com> wrote:
Actually, after years of developers complaining about the overly-aggressive and useless message only Firefox was showing, it looks like modern versions don't.

Do you know if that's because they optimized it, or they just gave up showing the message?

At this point I believe this is a GJS only issue because it's based on old version of moz.js

Is there any roadmap available to understand when I can drop transpilation all together and use ES2015 instead on GJS?

The roadmap is "as fast as I can" :-) I think it's safe to say that mozjs 52 will be landed in GNOME 3.26.

On Fri, Apr 14, 2017 at 12:43 PM, Andrea Giammarchi <andrea giammarchi gmail com> wrote:
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]