diff options
| author | Gubolin <gubolin@fantasymail.de> | 2015-01-02 10:27:39 +0100 |
|---|---|---|
| committer | Gubolin <gubolin@fantasymail.de> | 2015-01-02 10:27:39 +0100 |
| commit | 32e5a9b77a3db25a2562bfab10df3feb94cebb63 (patch) | |
| tree | fc47b01079864c68dbf635717519f5516fd76264 /objects.js | |
| parent | 524659048602c2812ef431813615a7a03ac90892 (diff) | |
| parent | b31df39d7f126eaa303c8dae1cf6a14c739a2cc5 (diff) | |
| download | snap-32e5a9b77a3db25a2562bfab10df3feb94cebb63.tar.gz snap-32e5a9b77a3db25a2562bfab10df3feb94cebb63.zip | |
merge upstream
Diffstat (limited to 'objects.js')
| -rw-r--r-- | objects.js | 27 |
1 files changed, 25 insertions, 2 deletions
@@ -125,7 +125,7 @@ PrototypeHatBlockMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.objects = '2014-December-04'; +modules.objects = '2014-December-17'; var SpriteMorph; var StageMorph; @@ -837,6 +837,12 @@ SpriteMorph.prototype.initBlocks = function () { category: 'sensing', spec: 'frames' }, + reportThreadCount: { + dev: true, + type: 'reporter', + category: 'sensing', + spec: 'processes' + }, doAsk: { type: 'command', category: 'sensing', @@ -1995,6 +2001,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')); @@ -3716,6 +3724,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) { @@ -5225,6 +5243,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')); @@ -5702,6 +5722,9 @@ StageMorph.prototype.watcherFor = StageMorph.prototype.getLastAnswer = SpriteMorph.prototype.getLastAnswer; +StageMorph.prototype.reportThreadCount + = SpriteMorph.prototype.reportThreadCount; + // StageMorph message broadcasting StageMorph.prototype.allMessageNames @@ -6961,7 +6984,7 @@ WatcherMorph.prototype.object = function () { WatcherMorph.prototype.isGlobal = function (selector) { return contains( ['getLastAnswer', 'getKeysPressed', 'getLastMessage', 'getTempo', 'getTimer', - 'reportMouseX', 'reportMouseY'], + 'reportMouseX', 'reportMouseY', 'reportThreadCount'], selector ); }; |
