summaryrefslogtreecommitdiff
path: root/threads.js
diff options
context:
space:
mode:
Diffstat (limited to 'threads.js')
-rw-r--r--threads.js17
1 files changed, 9 insertions, 8 deletions
diff --git a/threads.js b/threads.js
index d489441..50abf78 100644
--- a/threads.js
+++ b/threads.js
@@ -83,7 +83,7 @@ ArgLabelMorph, localize, XML_Element, hex_sha512*/
// Global stuff ////////////////////////////////////////////////////////
-modules.threads = '2014-Jun-05';
+modules.threads = '2014-July-11';
var ThreadManager;
var Process;
@@ -673,11 +673,13 @@ Process.prototype.doYield = function () {
// Process Exception Handling
Process.prototype.handleError = function (error, element) {
+ var m = element;
this.stop();
this.errorFlag = true;
this.topBlock.addErrorHighlight();
- (element || this.topBlock).showBubble(
- (element ? '' : 'Inside: ')
+ if (isNil(m) || isNil(m.world())) {m = this.topBlock; }
+ m.showBubble(
+ (m === element ? '' : 'Inside: ')
+ error.name
+ '\n'
+ error.message
@@ -1057,7 +1059,6 @@ Process.prototype.evaluateCustomBlock = function () {
}
};
-
// Process variables primitives
Process.prototype.doDeclareVariables = function (varNames) {
@@ -2234,14 +2235,14 @@ Process.prototype.getObjectsNamed = function (name, thisObj, stageObj) {
};
Process.prototype.doFaceTowards = function (name) {
- var thisObj = this.homeContext.receiver,
+ var thisObj = this.blockReceiver(),
thatObj;
if (thisObj) {
if (this.inputOption(name) === 'mouse-pointer') {
thisObj.faceToXY(this.reportMouseX(), this.reportMouseY());
} else {
- thatObj = this.getOtherObject(name, thisObj);
+ thatObj = this.getOtherObject(name, this.homeContext.receiver);
if (thatObj) {
thisObj.faceToXY(
thatObj.xPosition(),
@@ -2253,14 +2254,14 @@ Process.prototype.doFaceTowards = function (name) {
};
Process.prototype.doGotoObject = function (name) {
- var thisObj = this.homeContext.receiver,
+ var thisObj = this.blockReceiver(),
thatObj;
if (thisObj) {
if (this.inputOption(name) === 'mouse-pointer') {
thisObj.gotoXY(this.reportMouseX(), this.reportMouseY());
} else {
- thatObj = this.getOtherObject(name, thisObj);
+ thatObj = this.getOtherObject(name, this.homeContext.receiver);
if (thatObj) {
thisObj.gotoXY(
thatObj.xPosition(),