cleanup: Avoid implicit coercion
Converting a variable to a particular type can be done explicitly (with functions like Number() or toString()) or implicitly by relying on type coercion (like concatenating a variable to the empty string to force a string, or multiplying it with 1 to force a number). As those tend to be less readable and clear, they are best avoided. So replace the cases of string coercion we use with template strings, and clarify the places that can be confused with number coercion. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/607
This commit is contained in:
@ -658,7 +658,7 @@ function _queueBeforeRedraw(workId) {
|
||||
*/
|
||||
function initializeDeferredWork(actor, callback, props) {
|
||||
// Turn into a string so we can use as an object property
|
||||
let workId = '' + (++_deferredWorkSequence);
|
||||
let workId = `${(++_deferredWorkSequence)}`;
|
||||
_deferredWorkData[workId] = { 'actor': actor,
|
||||
'callback': callback };
|
||||
actor.connect('notify::mapped', () => {
|
||||
|
Reference in New Issue
Block a user