fixed some minor variable-renaming issues

snap7
jmoenig 2021-11-06 21:47:50 +01:00
rodzic ff5a930c86
commit 98f4c5c50f
3 zmienionych plików z 41 dodań i 2 usunięć

Wyświetl plik

@ -41,6 +41,7 @@
* fixed outdated blocks specs for "When I am ..." hat block in many translations * fixed outdated blocks specs for "When I am ..." hat block in many translations
* fixed duplicating custom block definitions that don't have a body * fixed duplicating custom block definitions that don't have a body
* allow selecting the fill color in the vector editor via touch-hold gesture on touch devices * allow selecting the fill color in the vector editor via touch-hold gesture on touch devices
* fixed some minor variable-renaming issues
* **Documentation Updates:** * **Documentation Updates:**
* updated manual, thanks Brian! * updated manual, thanks Brian!
* updated readme, thanks, Michael! * updated readme, thanks, Michael!
@ -48,6 +49,9 @@
* German * German
* Chinese, thanks, Simon! * Chinese, thanks, Simon!
### 2021-11-06
* blocks: fixed some minor variable-renaming issues
### 2021-11-03 ### 2021-11-03
* sketch: allow selecting the fill color in the vector editor via touch-hold gesture on touch devices * sketch: allow selecting the fill color in the vector editor via touch-hold gesture on touch devices
* updated version history * updated version history

Wyświetl plik

@ -16,7 +16,7 @@
<script src="src/morphic.js?version=2021-07-09"></script> <script src="src/morphic.js?version=2021-07-09"></script>
<script src="src/symbols.js?version=2021-03-03"></script> <script src="src/symbols.js?version=2021-03-03"></script>
<script src="src/widgets.js?version=2021-10-26"></script> <script src="src/widgets.js?version=2021-10-26"></script>
<script src="src/blocks.js?version=2021-10-29"></script> <script src="src/blocks.js?version=2021-11-06"></script>
<script src="src/threads.js?version=2021-10-22"></script> <script src="src/threads.js?version=2021-10-22"></script>
<script src="src/objects.js?version=2021-10-29"></script> <script src="src/objects.js?version=2021-10-29"></script>
<script src="src/scenes.js?version=2021-10-12"></script> <script src="src/scenes.js?version=2021-10-12"></script>

Wyświetl plik

@ -160,7 +160,7 @@ CustomCommandBlockMorph, ToggleButtonMorph, DialMorph, SnapExtensions*/
// Global stuff //////////////////////////////////////////////////////// // Global stuff ////////////////////////////////////////////////////////
modules.blocks = '2021-October-29'; modules.blocks = '2021-November-06';
var SyntaxElementMorph; var SyntaxElementMorph;
var BlockMorph; var BlockMorph;
@ -3952,7 +3952,14 @@ BlockMorph.prototype.refactorThisVar = function (justTheTemplate) {
); );
function renameVarTo (newName) { function renameVarTo (newName) {
var block;
if (this.parent instanceof SyntaxElementMorph) { if (this.parent instanceof SyntaxElementMorph) {
// commented out by jens and reformulated below
// in an attempt to catch some bugs in v6:
/*
if (this.parentThatIsA(BlockEditorMorph)) { if (this.parentThatIsA(BlockEditorMorph)) {
this.doRefactorBlockParameter( this.doRefactorBlockParameter(
oldName, oldName,
@ -3964,6 +3971,34 @@ BlockMorph.prototype.refactorThisVar = function (justTheTemplate) {
} else { } else {
this.doRefactorScriptVar(oldName, newName, justTheTemplate); this.doRefactorScriptVar(oldName, newName, justTheTemplate);
} }
*/
// trying to make some things more reliable below,
// I guess at one point we'll have to rethink the
// whole mechanism (jens)
if (this.parent instanceof BlockInputFragmentMorph) {
this.doRefactorBlockParameter(
oldName,
newName,
justTheTemplate
);
} else if (this.parent instanceof TemplateSlotMorph) {
block = this.parent.parentThatIsA(BlockMorph);
if (block instanceof RingMorph) {
this.doRefactorRingParameter(
oldName,
newName,
justTheTemplate
);
} else if (block.selector === 'doDeclareVariables') {
this.doRefactorScriptVar(oldName, newName, justTheTemplate);
} else {
// I guess it could also be an upvar ... (jens)
// perhaps we should show an error here?
}
}
} else if (receiver.hasSpriteVariable(oldName)) { } else if (receiver.hasSpriteVariable(oldName)) {
this.doRefactorSpriteVar(oldName, newName, justTheTemplate); this.doRefactorSpriteVar(oldName, newName, justTheTemplate);
} else { } else {