From 168c328836c01d69418621921a50be5d2eea3039 Mon Sep 17 00:00:00 2001 From: Jens Mönig Date: Mon, 2 Mar 2015 00:39:13 -0800 Subject: fixed #730 caching is evil, haha! --- byob.js | 12 +++++++++++- history.txt | 4 ++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/byob.js b/byob.js index 634d62d..c9f3daa 100644 --- a/byob.js +++ b/byob.js @@ -106,7 +106,7 @@ SymbolMorph, isNil*/ // Global stuff //////////////////////////////////////////////////////// -modules.byob = '2015-February-28'; +modules.byob = '2015-March-02'; // Declarations @@ -429,6 +429,7 @@ CustomCommandBlockMorph.prototype.refresh = function () { // find unnahmed upvars and label them // to their internal definition (default) + this.cachedInputs = null; this.inputs().forEach(function (inp, idx) { if (inp instanceof TemplateSlotMorph && inp.contents() === '\u2191') { inp.setContents(def.inputNames()[idx]); @@ -443,6 +444,7 @@ CustomCommandBlockMorph.prototype.restoreInputs = function (oldInputs) { myself = this; if (this.isPrototype) {return; } + this.cachedInputs = null; this.inputs().forEach(function (inp) { old = oldInputs[i]; if (old instanceof ReporterBlockMorph && @@ -460,6 +462,7 @@ CustomCommandBlockMorph.prototype.restoreInputs = function (oldInputs) { } i += 1; }); + this.cachedInputs = null; }; CustomCommandBlockMorph.prototype.refreshDefaults = function () { @@ -472,6 +475,7 @@ CustomCommandBlockMorph.prototype.refreshDefaults = function () { } idx += 1; }); + this.cachedInputs = null; }; CustomCommandBlockMorph.prototype.refreshPrototype = function () { @@ -924,6 +928,9 @@ CustomReporterBlockMorph.prototype.refresh = function () { if (!this.isPrototype) { this.isPredicate = (this.definition.type === 'predicate'); } + if (this.parent instanceof SyntaxElementMorph) { + this.parent.cachedInputs = null; + } this.drawNew(); }; @@ -1865,6 +1872,9 @@ BlockEditorMorph.prototype.context = function (prototypeHat) { if (topBlock === null) { return null; } + topBlock.allChildren().forEach(function (c) { + if (c instanceof BlockMorph) {c.cachedInputs = null; } + }); stackFrame = Process.prototype.reify.call( null, topBlock, diff --git a/history.txt b/history.txt index 1f0ec00..0f92071 100755 --- a/history.txt +++ b/history.txt @@ -2458,3 +2458,7 @@ ______ * Objects: slightly optimize warped / turbo execution * Threads: fixed #715 * BYOB: fixed #716 + +150302 +------ +* BYOB: fixed #730 -- cgit v1.3.1