Throw an error for “obsolete” blocks

instead of (forever) doing nothing (and thus often freezing and
crashing). Thanks, Paul, for helping identify this!
dev
Jens Mönig 2016-01-19 00:03:17 +01:00
rodzic 291555d9e1
commit 825c5f5568
3 zmienionych plików z 12 dodań i 4 usunięć

Wyświetl plik

@ -2858,3 +2858,7 @@ end - bulk of 151215
------ ------
* Paint: avoid pixel collision detection in PaintCanvas (optimization) * Paint: avoid pixel collision detection in PaintCanvas (optimization)
* BYOB: fixed a zebra coloring glitch in the block editor * BYOB: fixed a zebra coloring glitch in the block editor
160119
------
* Threads, Store: Throw an error for “obsolete” blocks instead of (forever) doing nothing (and thus often freezing and crashing). Thanks, Paul, for helping identify this!

Wyświetl plik

@ -7,7 +7,7 @@
written by Jens Mönig written by Jens Mönig
jens@moenig.org jens@moenig.org
Copyright (C) 2015 by Jens Mönig Copyright (C) 2016 by Jens Mönig
This file is part of Snap!. This file is part of Snap!.
@ -61,7 +61,7 @@ SyntaxElementMorph, Variable*/
// Global stuff //////////////////////////////////////////////////////// // Global stuff ////////////////////////////////////////////////////////
modules.store = '2015-December-15'; modules.store = '2016-January-19';
// XML_Serializer /////////////////////////////////////////////////////// // XML_Serializer ///////////////////////////////////////////////////////
@ -1073,7 +1073,7 @@ SnapSerializer.prototype.obsoleteBlock = function (isReporter) {
// private // private
var block = isReporter ? new ReporterBlockMorph() var block = isReporter ? new ReporterBlockMorph()
: new CommandBlockMorph(); : new CommandBlockMorph();
block.selector = 'nop'; block.selector = 'errorObsolete';
block.color = new Color(200, 0, 20); block.color = new Color(200, 0, 20);
block.setSpec('Obsolete!'); block.setSpec('Obsolete!');
block.isDraggable = true; block.isDraggable = true;

Wyświetl plik

@ -83,7 +83,7 @@ ArgLabelMorph, localize, XML_Element, hex_sha512*/
// Global stuff //////////////////////////////////////////////////////// // Global stuff ////////////////////////////////////////////////////////
modules.threads = '2016-January-08'; modules.threads = '2016-January-19';
var ThreadManager; var ThreadManager;
var Process; var Process;
@ -869,6 +869,10 @@ Process.prototype.handleError = function (error, element) {
); );
}; };
Process.prototype.errorObsolete = function () {
throw new Error('a custom block definition is missing');
};
// Process Lambda primitives // Process Lambda primitives
Process.prototype.reify = function (topBlock, parameterNames, isCustomBlock) { Process.prototype.reify = function (topBlock, parameterNames, isCustomBlock) {