After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 785084 - Unbreak after gjs' mozjs update
Unbreak after gjs' mozjs update
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2017-07-18 18:44 UTC by Florian Müllner
Modified: 2017-07-18 19:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
messageTray: Use spread syntax to get map keys (891 bytes, patch)
2017-07-18 18:44 UTC, Florian Müllner
committed Details | Review
appDisplay: Define constant before using it (1.30 KB, patch)
2017-07-18 18:44 UTC, Florian Müllner
committed Details | Review
main: Define global properties with 'var' instead of 'let' (2.64 KB, patch)
2017-07-18 18:44 UTC, Florian Müllner
committed Details | Review
Define classes with 'var' instead of 'const' (110.04 KB, patch)
2017-07-18 18:45 UTC, Florian Müllner
committed Details | Review
Define externally accessible contants with 'var' instead of 'const' (53.98 KB, patch)
2017-07-18 18:45 UTC, Florian Müllner
committed Details | Review

Description Florian Müllner 2017-07-18 18:44:33 UTC
GJS broke gnome-shell by updating mozjs to version 52. The first three patches should make it run again, while the remaining two "only" fix a warning flood in the logs.
Comment 1 Florian Müllner 2017-07-18 18:44:41 UTC
Created attachment 355869 [details] [review]
messageTray: Use spread syntax to get map keys

It wasn't supported when the code was originally written, now the
fill-in code isn't accepted anymore ...
Comment 2 Florian Müllner 2017-07-18 18:44:48 UTC
Created attachment 355870 [details] [review]
appDisplay: Define constant before using it

This is now a fatal error with current gjs, however I wonder: Did this
ever work?
Comment 3 Florian Müllner 2017-07-18 18:44:55 UTC
Created attachment 355871 [details] [review]
main: Define global properties with 'var' instead of 'let'

Symbols that are defined with 'let' are no longer visible outside
the module that defines them. To unbreak the code base, define all
non-private properties as global.
Comment 4 Florian Müllner 2017-07-18 18:45:05 UTC
Created attachment 355872 [details] [review]
Define classes with 'var' instead of 'const'

Any symbols (including class properties) that should be visible
outside the module it's defined in need to be defined as global.
For now gjs still allows the access for 'const', but get rid of
the warnings spill now by changing it.
Comment 5 Florian Müllner 2017-07-18 18:45:12 UTC
Created attachment 355873 [details] [review]
Define externally accessible contants with 'var' instead of 'const'

Just as we did with classes, define other constants that are (or
may be) used from other modules with 'var' to cut down on warnings.
Comment 6 Rui Matos 2017-07-18 19:22:37 UTC
Review of attachment 355869 [details] [review]:

sure

::: js/ui/messageTray.js
@@ +1044,2 @@
     getSources: function() {
+        return [...this._sources.keys()];

seems equivalent to return this._sources.keys(); but ok
Comment 7 Rui Matos 2017-07-18 19:24:37 UTC
Review of attachment 355870 [details] [review]:

:thinking-face:
Comment 8 Rui Matos 2017-07-18 19:25:15 UTC
Review of attachment 355871 [details] [review]:

ok
Comment 9 Rui Matos 2017-07-18 19:26:39 UTC
Review of attachment 355872 [details] [review]:

fine...
Comment 10 Rui Matos 2017-07-18 19:27:47 UTC
Review of attachment 355873 [details] [review]:

lgtm
Comment 11 Florian Müllner 2017-07-18 19:52:43 UTC
(In reply to Rui Matos from comment #6)
> @@ +1044,2 @@
>      getSources: function() {
> +        return [...this._sources.keys()];
> 
> seems equivalent to return this._sources.keys(); but ok

No, keys() returns a map iterator, not an array.

Attachment 355869 [details] pushed as a593e45 - messageTray: Use spread syntax to get map keys
Attachment 355870 [details] pushed as 6a2af25 - appDisplay: Define constant before using it
Attachment 355871 [details] pushed as 9e32ba6 - main: Define global properties with 'var' instead of 'let'
Attachment 355872 [details] pushed as 2582d16 - Define classes with 'var' instead of 'const'
Attachment 355873 [details] pushed as 033277b - Define externally accessible contants with 'var' instead of 'const'