Cleanup of some minor old cruft in the js code.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4757 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2024-01-11 02:11:24 +00:00
parent 74eb74deb1
commit f4979c841a

View File

@ -3,7 +3,6 @@ import * as auth from './auth.js';
import * as form from './form.js'; import * as form from './form.js';
import * as http from './http.js'; import * as http from './http.js';
let gProcessIndex = 0;
let gProcesses = {}; let gProcesses = {};
let gStatsTimer = false; let gStatsTimer = false;
@ -125,8 +124,7 @@ function invoke(handlers, argv) {
function broadcastEvent(eventName, argv) { function broadcastEvent(eventName, argv) {
let promises = []; let promises = [];
for (let i in gProcesses) { for (let process of Object.values(gProcesses)) {
let process = gProcesses[i];
if (process.eventHandlers[eventName]) { if (process.eventHandlers[eventName]) {
promises.push(invoke(process.eventHandlers[eventName], argv)); promises.push(invoke(process.eventHandlers[eventName], argv));
} }
@ -137,8 +135,7 @@ function broadcastEvent(eventName, argv) {
function broadcast(message) { function broadcast(message) {
let sender = this; let sender = this;
let promises = []; let promises = [];
for (let i in gProcesses) { for (let process of Object.values(gProcesses)) {
let process = gProcesses[i];
if (process != sender if (process != sender
&& process.packageOwner == sender.packageOwner && process.packageOwner == sender.packageOwner
&& process.packageName == sender.packageName) { && process.packageName == sender.packageName) {
@ -151,9 +148,7 @@ function broadcast(message) {
function getUser(caller, process) { function getUser(caller, process) {
return { return {
name: process.userName,
key: process.key, key: process.key,
index: process.index,
packageOwner: process.packageOwner, packageOwner: process.packageOwner,
packageName: process.packageName, packageName: process.packageName,
credentials: process.credentials, credentials: process.credentials,
@ -208,8 +203,6 @@ async function getProcessBlob(blobId, key, options) {
print("Creating task for " + blobId + " " + key); print("Creating task for " + blobId + " " + key);
process = {}; process = {};
process.key = key; process.key = key;
process.index = gProcessIndex++;
process.userName = 'user' + process.index;
process.credentials = options.credentials || {}; process.credentials = options.credentials || {};
process.task = new Task(); process.task = new Task();
process.eventHandlers = {}; process.eventHandlers = {};