GNOME Bugzilla – Bug 785084
Unbreak after gjs' mozjs update
Last modified: 2017-07-18 19:53:10 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.
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 ...
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?
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.
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.
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.
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
Review of attachment 355870 [details] [review]: :thinking-face:
Review of attachment 355871 [details] [review]: ok
Review of attachment 355872 [details] [review]: fine...
Review of attachment 355873 [details] [review]: lgtm
(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'