From 802ace18d18784a026a7c1c0466da264828b8227 Mon Sep 17 00:00:00 2001 From: Jens Mönig Date: Mon, 9 Mar 2015 07:09:43 +0100 Subject: fixed #738 --- blocks.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'blocks.js') diff --git a/blocks.js b/blocks.js index c519703..d82d788 100644 --- a/blocks.js +++ b/blocks.js @@ -155,7 +155,7 @@ DialogBoxMorph, BlockInputFragmentMorph, PrototypeHatBlockMorph, Costume*/ // Global stuff //////////////////////////////////////////////////////// -modules.blocks = '2015-March-06'; +modules.blocks = '2015-March-09'; var SyntaxElementMorph; @@ -400,10 +400,14 @@ SyntaxElementMorph.prototype.debugCachedInputs = function () { } for (i = 0; i < realInputs.length; i += 1) { if (this.cachedInputs[i] !== realInputs[i]) { - throw new Error('cached input does not match ' + + throw new Error('cached input does not match: ' + this.constructor.name + + ' #' + + i + ' ' + - i); + this.cachedInputs[i].constructor.name + + ' != ' + + realInputs[i].constructor.name); } } }; @@ -3059,6 +3063,9 @@ BlockMorph.prototype.fullCopy = function () { ans.setSpec(this.instantiationSpec); } ans.allChildren().filter(function (block) { + if (block instanceof SyntaxElementMorph) { + block.cachedInputs = null; + } return !isNil(block.comment); }).forEach(function (block) { var cmnt = block.comment.fullCopy(); -- cgit v1.3.1 From 31ea6f603085827ba95f20f55faca3e4fa85365e Mon Sep 17 00:00:00 2001 From: Jens Mönig Date: Mon, 9 Mar 2015 07:39:51 +0100 Subject: Only enable input caching for blocks --- blocks.js | 11 ++--------- gui.js | 8 ++++---- 2 files changed, 6 insertions(+), 13 deletions(-) (limited to 'blocks.js') diff --git a/blocks.js b/blocks.js index d82d788..aef09da 100644 --- a/blocks.js +++ b/blocks.js @@ -340,7 +340,7 @@ SyntaxElementMorph.prototype.setScale = function (num) { }; SyntaxElementMorph.prototype.setScale(1); -SyntaxElementMorph.prototype.isCachingInputs = true; +SyntaxElementMorph.prototype.isCachingInputs = false; // SyntaxElementMorph instance creation: @@ -1943,6 +1943,7 @@ BlockMorph.uber = SyntaxElementMorph.prototype; // BlockMorph preferences settings: +BlockMorph.prototype.isCachingInputs = true; BlockMorph.prototype.zebraContrast = 40; // alternating color brightness // BlockMorph sound feedback: @@ -9228,10 +9229,6 @@ MultiArgMorph.prototype = new ArgMorph(); MultiArgMorph.prototype.constructor = MultiArgMorph; MultiArgMorph.uber = ArgMorph.prototype; -// MultiArgMorph preferences settings - -MultiArgMorph.prototype.isCachingInputs = false; - // MultiArgMorph instance creation: function MultiArgMorph( @@ -9662,10 +9659,6 @@ ArgLabelMorph.prototype = new ArgMorph(); ArgLabelMorph.prototype.constructor = ArgLabelMorph; ArgLabelMorph.uber = ArgMorph.prototype; -// ArgLabelMorph preferences settings - -ArgLabelMorph.prototype.isCachingInputs = false; - // MultiArgMorph instance creation: function ArgLabelMorph(argMorph, labelTxt) { diff --git a/gui.js b/gui.js index 75220b3..b103ccc 100644 --- a/gui.js +++ b/gui.js @@ -69,7 +69,7 @@ SpeechBubbleMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.gui = '2015-February-28'; +modules.gui = '2015-March-09'; // Declarations @@ -2269,10 +2269,10 @@ IDE_Morph.prototype.settingsMenu = function () { addPreference( 'Cache Inputs', function () { - SyntaxElementMorph.prototype.isCachingInputs = - !SyntaxElementMorph.prototype.isCachingInputs; + BlockMorph.prototype.isCachingInputs = + !BlockMorph.prototype.isCachingInputs; }, - SyntaxElementMorph.prototype.isCachingInputs, + BlockMorph.prototype.isCachingInputs, 'uncheck to stop caching\ninputs (for debugging the evaluator)', 'check to cache inputs\nboosts recursion', true -- cgit v1.3.1