fixed two issues when forking processes while single-stepping

* suppress "exit" context when forking a process while single-stepping,
this avoids a false "reporter didn't report" error message
* avoid coloring the block-highlight when re-coloring a syntax element,
this prevents highlighted blocks inside LAUNCH statements to expand
when repeatedly single-stepped.
upd4.2 4.1.0.4
Jens Mönig 2017-11-16 18:18:35 +01:00
rodzic aaa645cab0
commit 94d8beb741
4 zmienionych plików z 25 dodań i 15 usunięć

Wyświetl plik

@ -148,7 +148,7 @@ CustomCommandBlockMorph, SymbolMorph, ToggleButtonMorph*/
// Global stuff //////////////////////////////////////////////////////// // Global stuff ////////////////////////////////////////////////////////
modules.blocks = '2017-October-17'; modules.blocks = '2017-November-16';
var SyntaxElementMorph; var SyntaxElementMorph;
var BlockMorph; var BlockMorph;
@ -737,7 +737,8 @@ SyntaxElementMorph.prototype.setColor = function (aColor, silently) {
this.color = aColor; this.color = aColor;
if (!silently) {this.drawNew(); } if (!silently) {this.drawNew(); }
this.children.forEach(function (child) { this.children.forEach(function (child) {
if (!silently || child instanceof TemplateSlotMorph) { if ((!silently || child instanceof TemplateSlotMorph) &&
!(child instanceof BlockHighlightMorph)) {
child.drawNew(); child.drawNew();
child.changed(); child.changed();
} }

4
gui.js
Wyświetl plik

@ -75,7 +75,7 @@ isRetinaSupported, SliderMorph, Animation*/
// Global stuff //////////////////////////////////////////////////////// // Global stuff ////////////////////////////////////////////////////////
modules.gui = '2017-November-15'; modules.gui = '2017-November-16';
// Declarations // Declarations
@ -3386,7 +3386,7 @@ IDE_Morph.prototype.aboutSnap = function () {
module, btn1, btn2, btn3, btn4, licenseBtn, translatorsBtn, module, btn1, btn2, btn3, btn4, licenseBtn, translatorsBtn,
world = this.world(); world = this.world();
aboutTxt = 'Snap! 4.1.0.3\nBuild Your Own Blocks\n\n' aboutTxt = 'Snap! 4.1.0.4\nBuild Your Own Blocks\n\n'
+ 'Copyright \u24B8 2017 Jens M\u00F6nig and ' + 'Copyright \u24B8 2017 Jens M\u00F6nig and '
+ 'Brian Harvey\n' + 'Brian Harvey\n'
+ 'jens@moenig.org, bh@cs.berkeley.edu\n\n' + 'jens@moenig.org, bh@cs.berkeley.edu\n\n'

Wyświetl plik

@ -3795,3 +3795,10 @@ Fixes:
* new Audio Comp library for Guzdial-style sound samples fun * new Audio Comp library for Guzdial-style sound samples fun
=== v4.1.0.3 maintenance release === === v4.1.0.3 maintenance release ===
171116
------
* Threads: suppress "exit" context when forking a process while single-stepping, this avoids a false "reporter didn't report" error message
* Blocks: avoid coloring the block-highlight when re-coloring a syntax element, this prevents highlighted blocks inside LAUNCH statements to expand when repeatedly single-stepped.
=== v4.1.0.4 maintenance release ===

Wyświetl plik

@ -61,7 +61,7 @@ StageMorph, SpriteMorph, StagePrompterMorph, Note, modules, isString, copy,
isNil, WatcherMorph, List, ListWatcherMorph, alert, console, TableMorph, isNil, WatcherMorph, List, ListWatcherMorph, alert, console, TableMorph,
TableFrameMorph, ColorSlotMorph, isSnapObject*/ TableFrameMorph, ColorSlotMorph, isSnapObject*/
modules.threads = '2017-October-20'; modules.threads = '2017-November-16';
var ThreadManager; var ThreadManager;
var Process; var Process;
@ -1166,12 +1166,12 @@ Process.prototype.fork = function (context, args) {
stage = this.homeContext.receiver.parentThatIsA(StageMorph); stage = this.homeContext.receiver.parentThatIsA(StageMorph);
proc.instrument = this.instrument; proc.instrument = this.instrument;
proc.receiver = this.receiver; proc.receiver = this.receiver;
proc.initializeFor(context, args); proc.initializeFor(context, args, this.enableSingleStepping);
// proc.pushContext('doYield'); // proc.pushContext('doYield');
stage.threads.processes.push(proc); stage.threads.processes.push(proc);
}; };
Process.prototype.initializeFor = function (context, args) { Process.prototype.initializeFor = function (context, args, ignoreExit) {
// used by Process.fork() and global invoke() // used by Process.fork() and global invoke()
if (context.isContinuation) { if (context.isContinuation) {
throw new Error( throw new Error(
@ -1243,14 +1243,16 @@ Process.prototype.initializeFor = function (context, args) {
// insert a tagged exit context // insert a tagged exit context
// which "report" can catch later // which "report" can catch later
// needed for invoke() situations // needed for invoke() situations
exit = new Context( if (!ignoreExit) { // when single stepping LAUNCH
runnable.parentContext, exit = new Context(
'expectReport', runnable.parentContext,
outer, 'expectReport',
outer.receiver outer,
); outer.receiver
exit.tag = 'exit'; );
runnable.parentContext = exit; exit.tag = 'exit';
runnable.parentContext = exit;
}
} }
this.homeContext = new Context(); // context.outerContext; this.homeContext = new Context(); // context.outerContext;