cleanup: Use arrow notation for anonymous functions
Arrow notation is great, use it consistently through-out the code base to bind `this` to anonymous functions, replacing the more overbose Lang.bind(this, function() {}). https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/23
This commit is contained in:

committed by
Florian Müllner

parent
76f09b1e49
commit
213e38c2ef
@ -62,14 +62,14 @@ function test() {
|
||||
|
||||
resize_animated(label1);
|
||||
resize_animated(label2);
|
||||
Mainloop.timeout_add(DELAY, Lang.bind(this, function() {
|
||||
Mainloop.timeout_add(DELAY, () => {
|
||||
log(label1 + label1.get_size());
|
||||
resize_animated(label1);
|
||||
resize_animated(label2);
|
||||
return true;
|
||||
}));
|
||||
});
|
||||
|
||||
Mainloop.timeout_add(2 * DELAY, Lang.bind(this, function() {
|
||||
Mainloop.timeout_add(2 * DELAY, () => {
|
||||
iter += 1;
|
||||
iter %= shadowStyles.length;
|
||||
label1.set_style(get_css_style(shadowStyles[iter]));
|
||||
@ -77,7 +77,7 @@ function test() {
|
||||
label2.set_style(get_css_style(shadowStyles[iter]));
|
||||
label2.set_text(shadowStyles[iter]);
|
||||
return true;
|
||||
}));
|
||||
});
|
||||
|
||||
UI.main(stage);
|
||||
}
|
||||
|
Reference in New Issue
Block a user