summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2014-07-22 12:33:26 +0200
committerjmoenig <jens@moenig.org>2014-07-22 12:33:26 +0200
commitdf25b4dc73b97dba899ff28d63474a28650c4c18 (patch)
treec49634a4813c4a8a575659e13595effa70152b70
parent15a751ad85b424703502e881ed8aaabdffe18e3e (diff)
downloadsnap-df25b4dc73b97dba899ff28d63474a28650c4c18.tar.gz
snap-df25b4dc73b97dba899ff28d63474a28650c4c18.zip
fixed #521
deleting variable watchers by dropping them on the palette resulted in wrong ones to be created when showing them again
-rwxr-xr-xhistory.txt4
-rw-r--r--objects.js5
-rw-r--r--threads.js9
3 files changed, 15 insertions, 3 deletions
diff --git a/history.txt b/history.txt
index 774f798..573786d 100755
--- a/history.txt
+++ b/history.txt
@@ -2214,3 +2214,7 @@ ______
140721
------
* fixed #518
+
+140722
+------
+* Objects, Threads: fixed #521 (deleting variable watchers by dropping them on the palette results in wrong ones to be created when showing them again)
diff --git a/objects.js b/objects.js
index e395369..af68ceb 100644
--- a/objects.js
+++ b/objects.js
@@ -125,7 +125,7 @@ PrototypeHatBlockMorph*/
// Global stuff ////////////////////////////////////////////////////////
-modules.objects = '2014-July-17';
+modules.objects = '2014-July-22';
var SpriteMorph;
var StageMorph;
@@ -3545,6 +3545,9 @@ SpriteMorph.prototype.toggleVariableWatcher = function (varName, isGlobal) {
}
// if no watcher exists, create a new one
+ if (isNil(isGlobal)) {
+ isGlobal = contains(this.variables.parentFrame.names(), varName);
+ }
watcher = new WatcherMorph(
varName,
this.blockColor.variables,
diff --git a/threads.js b/threads.js
index 9251b95..fccb2a3 100644
--- a/threads.js
+++ b/threads.js
@@ -83,7 +83,7 @@ ArgLabelMorph, localize, XML_Element, hex_sha512*/
// Global stuff ////////////////////////////////////////////////////////
-modules.threads = '2014-July-21';
+modules.threads = '2014-July-22';
var ThreadManager;
var Process;
@@ -1109,6 +1109,7 @@ Process.prototype.doShowVar = function (varName) {
target,
label,
others,
+ isGlobal,
name = varName;
if (name instanceof Context) {
@@ -1135,7 +1136,11 @@ Process.prototype.doShowVar = function (varName) {
return;
}
// if no watcher exists, create a new one
- if (target.owner) {
+ isGlobal = contains(
+ this.homeContext.receiver.variables.parentFrame.names(),
+ varName
+ );
+ if (isGlobal || target.owner) {
label = name;
} else {
label = name + ' (temporary)';