aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--script.js16
1 files changed, 7 insertions, 9 deletions
diff --git a/script.js b/script.js
index 12f00cb1..77758571 100644
--- a/script.js
+++ b/script.js
@@ -37,17 +37,15 @@ function onOptionsChanged(callback) {
optionsChangedCallbacks.push(callback);
}
-function runCallback(x, m) {
- try {
- x(m);
- } catch (e) {
- console.error("error running callback", x, ":", e);
+function executeCallbacks(queue, arg) {
+ for (const callback of queue) {
+ try {
+ callback(arg);
+ } catch (e) {
+ console.error("error running callback", callback, ":", e);
+ }
}
}
-function executeCallbacks(queue, m) {
- queue.forEach(function(x) {
- runCallback(x, m);
- });
}
var executedOnLoaded = false;