[gnome-shell] environment: Replace monkey-patched method with Symbol.iterator
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] environment: Replace monkey-patched method with Symbol.iterator
- Date: Tue, 19 May 2020 19:40:21 +0000 (UTC)
commit e20cf1ac78810c8953d41b665a5f66c58e1c0628
Author: Florian Müllner <fmuellner gnome org>
Date: Tue May 19 21:29:49 2020 +0200
environment: Replace monkey-patched method with Symbol.iterator
This allows using the actor itself as iterator:
for (let child of container)
doStuff(child);
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1269
js/ui/environment.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/js/ui/environment.js b/js/ui/environment.js
index 44a92db361..a0b884eb3e 100644
--- a/js/ui/environment.js
+++ b/js/ui/environment.js
@@ -285,7 +285,7 @@ function init() {
_easeActorProperty(this, 'value', target, params);
};
- Clutter.Actor.prototype.iterate_children = function* () {
+ Clutter.Actor.prototype[Symbol.iterator] = function* () {
for (let c = this.get_first_child(); c; c = c.get_next_sibling())
yield c;
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]