make sure inheritance hierarchies are consistently made temporary

upd4.1
Jens Mönig 2017-09-28 09:59:15 +02:00
rodzic ad0d0f7803
commit a5a3d5cf65
2 zmienionych plików z 11 dodań i 1 usunięć

Wyświetl plik

@ -3669,6 +3669,7 @@ Fixes:
* GUI: enable experimental setting for "ternary Boolean slots" * GUI: enable experimental setting for "ternary Boolean slots"
* GUI, Blocks: experimental feature: Download script, thanks, Bernat! * GUI, Blocks: experimental feature: Download script, thanks, Bernat!
* Blocks: made "import script" undoable * Blocks: made "import script" undoable
* Objects: make sure inheritance hierarchies are consistently made temporary
v4.1 Features: v4.1 Features:

Wyświetl plik

@ -83,7 +83,7 @@ BlockEditorMorph, BlockDialogMorph, PrototypeHatBlockMorph, localize,
TableMorph, TableFrameMorph, normalizeCanvas, BooleanSlotMorph, HandleMorph, TableMorph, TableFrameMorph, normalizeCanvas, BooleanSlotMorph, HandleMorph,
AlignmentMorph*/ AlignmentMorph*/
modules.objects = '2017-September-25'; modules.objects = '2017-September-28';
var SpriteMorph; var SpriteMorph;
var StageMorph; var StageMorph;
@ -3412,6 +3412,10 @@ SpriteMorph.prototype.perpetuate = function () {
var stage = this.parentThatIsA(StageMorph), var stage = this.parentThatIsA(StageMorph),
ide = this.parentThatIsA(IDE_Morph); ide = this.parentThatIsA(IDE_Morph);
// make sure my exemplar-chain is fully perpetuated
if (this.exemplar) {
this.exemplar.perpetuate();
}
if (!this.isTemporary || !stage || !ide) { if (!this.isTemporary || !stage || !ide) {
return; return;
} }
@ -3446,9 +3450,14 @@ SpriteMorph.prototype.release = function () {
if (this.isTemporary || !this.exemplar || !stage || !ide) { if (this.isTemporary || !this.exemplar || !stage || !ide) {
return; return;
} }
// make sure all parts and instances are also released
this.parts.forEach(function (part) { this.parts.forEach(function (part) {
part.release(); part.release();
}); });
this.instances.forEach(function (inst) {
inst.release();
});
this.isTemporary = true; this.isTemporary = true;
this.name = ''; this.name = '';
this.cloneOriginName = this.exemplar.name; this.cloneOriginName = this.exemplar.name;