summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--objects.js8
-rw-r--r--threads.js9
2 files changed, 13 insertions, 4 deletions
diff --git a/objects.js b/objects.js
index 9399269..282d01f 100644
--- a/objects.js
+++ b/objects.js
@@ -4497,14 +4497,14 @@ StageMorph.prototype.newPeerMessage = function (data, peer) {
hats.forEach(function (block) {
var process = myself.threads.startProcess(block,
myself.isThreadSafe);
- process.context.outerContext.variables.addVar('message');
+ process.context.outerContext.variables.addVar(localize('message'));
process.context.outerContext.variables.setVar(
- 'message',
+ localize('message'),
message
);
- process.context.outerContext.variables.addVar('peer');
+ process.context.outerContext.variables.addVar(localize('peer'));
process.context.outerContext.variables.setVar(
- 'peer',
+ localize('peer'),
peer
);
});
diff --git a/threads.js b/threads.js
index bc8e429..2d1ce77 100644
--- a/threads.js
+++ b/threads.js
@@ -1298,6 +1298,15 @@ Process.prototype.doRemoveTemporaries = function () {
// Peer to peer primitives
Process.prototype.sendPeerMessage = function (message, peer) {
+ var myself = this;
+
+ if (peer instanceof List) {
+ peer.asArray().forEach(function (singlePeer) {
+ myself.sendPeerMessage(message, singlePeer);
+ });
+ return;
+ }
+
var stage = this.homeContext.receiver.parentThatIsA(StageMorph),
ide = this.homeContext.receiver.parentThatIsA(IDE_Morph);
var connection = stage.peer.connect(peer, {reliable: true});