summaryrefslogtreecommitdiff
path: root/objects.js
diff options
context:
space:
mode:
authorGubolin <gubolin@fantasymail.de>2015-01-08 19:30:02 +0100
committerGubolin <gubolin@fantasymail.de>2015-01-08 19:30:02 +0100
commit4d0e06ff5903d7ab56d5e25a71062ff40e0904cc (patch)
tree6c0f60fe8405c82da4a53253c847c1a0acda6011 /objects.js
parent2631b384cab44d8416b865d7ed666e844930092f (diff)
parent27370676f2bf925c3a8498fc2dfef959e1aa45bd (diff)
downloadsnap-4d0e06ff5903d7ab56d5e25a71062ff40e0904cc.tar.gz
snap-4d0e06ff5903d7ab56d5e25a71062ff40e0904cc.zip
Merge branch 'master' into mobileapp
Diffstat (limited to 'objects.js')
-rw-r--r--objects.js27
1 files changed, 25 insertions, 2 deletions
diff --git a/objects.js b/objects.js
index 7d1363a..140ac69 100644
--- a/objects.js
+++ b/objects.js
@@ -125,7 +125,7 @@ PrototypeHatBlockMorph*/
// Global stuff ////////////////////////////////////////////////////////
-modules.objects = '2014-December-04';
+modules.objects = '2014-December-17';
var SpriteMorph;
var StageMorph;
@@ -825,6 +825,12 @@ SpriteMorph.prototype.initBlocks = function () {
category: 'sensing',
spec: 'frames'
},
+ reportThreadCount: {
+ dev: true,
+ type: 'reporter',
+ category: 'sensing',
+ spec: 'processes'
+ },
doAsk: {
type: 'command',
category: 'sensing',
@@ -2002,6 +2008,8 @@ SpriteMorph.prototype.blockTemplates = function (category) {
txt.setColor(this.paletteTextColor);
blocks.push(txt);
blocks.push('-');
+ blocks.push(watcherToggle('reportThreadCount'));
+ blocks.push(block('reportThreadCount'));
blocks.push(block('colorFiltered'));
blocks.push(block('reportStackSize'));
blocks.push(block('reportFrameCount'));
@@ -3663,6 +3671,16 @@ SpriteMorph.prototype.reportMouseY = function () {
return 0;
};
+// SpriteMorph thread count (for debugging)
+
+SpriteMorph.prototype.reportThreadCount = function () {
+ var stage = this.parentThatIsA(StageMorph);
+ if (stage) {
+ return stage.threads.processes.length;
+ }
+ return 0;
+};
+
// SpriteMorph variable watchers (for palette checkbox toggling)
SpriteMorph.prototype.findVariableWatcher = function (varName) {
@@ -5166,6 +5184,8 @@ StageMorph.prototype.blockTemplates = function (category) {
txt.setColor(this.paletteTextColor);
blocks.push(txt);
blocks.push('-');
+ blocks.push(watcherToggle('reportThreadCount'));
+ blocks.push(block('reportThreadCount'));
blocks.push(block('colorFiltered'));
blocks.push(block('reportStackSize'));
blocks.push(block('reportFrameCount'));
@@ -5616,6 +5636,9 @@ StageMorph.prototype.watcherFor =
StageMorph.prototype.getLastAnswer
= SpriteMorph.prototype.getLastAnswer;
+StageMorph.prototype.reportThreadCount
+ = SpriteMorph.prototype.reportThreadCount;
+
// StageMorph message broadcasting
StageMorph.prototype.allMessageNames
@@ -6864,7 +6887,7 @@ WatcherMorph.prototype.object = function () {
WatcherMorph.prototype.isGlobal = function (selector) {
return contains(
['getLastAnswer', 'getLastMessage', 'getTempo', 'getTimer',
- 'reportMouseX', 'reportMouseY'],
+ 'reportMouseX', 'reportMouseY', 'reportThreadCount'],
selector
);
};