caching is evil, haha!
pull/3/merge
Jens Mönig 2015-03-02 00:39:13 -08:00
rodzic b1d7853255
commit 168c328836
2 zmienionych plików z 15 dodań i 1 usunięć

12
byob.js
Wyświetl plik

@ -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,

Wyświetl plik

@ -2458,3 +2458,7 @@ ______
* Objects: slightly optimize warped / turbo execution
* Threads: fixed #715
* BYOB: fixed #716
150302
------
* BYOB: fixed #730