Skip to content

Commit

Permalink
loosened type assertions to include hat blocks in some script related…
Browse files Browse the repository at this point in the history
… extensions
  • Loading branch information
jmoenig committed Dec 7, 2024
1 parent aca6705 commit 69f452d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

## in development:
* **Notable Fixes:**
fixed c-slot rendering for hat blocks
* fixed c-slot rendering for hat blocks
* loosened type assertions to include hat blocks in some script related extensions

### 2024-12-07
* blocks, santa: fixed c-slot rendering for hat blocks
* extensions: loosened type assertions to include hat blocks in some script related extensions

## 10.3.0:
* **New Features:**
Expand Down
2 changes: 1 addition & 1 deletion snap.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<script src="src/sketch.js?version=2023-05-24"></script>
<script src="src/video.js?version=2019-06-27"></script>
<script src="src/maps.js?version=2021-06-15"></script>
<script src="src/extensions.js?version=2024-11-21"></script>
<script src="src/extensions.js?version=2024-12-07"></script>
<script src="src/xml.js?version=2021-07-05"></script>
<script src="src/store.js?version=2024-11-25"></script>
<script src="src/locale.js?version=2024-12-04"></script>
Expand Down
8 changes: 4 additions & 4 deletions src/extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ BigUint64Array*/

/*jshint esversion: 11, bitwise: false*/

modules.extensions = '2024-November-21';
modules.extensions = '2024-December-07';

// Global stuff

Expand Down Expand Up @@ -249,7 +249,7 @@ SnapExtensions.primitives.set(
SnapExtensions.primitives.set(
'snap_xml_encode(script)',
function (script, proc) {
proc.assertType(script, ['command', 'reporter', 'predicate']);
proc.assertType(script, ['command', 'reporter', 'predicate', 'hat']);
return script.expression.toXMLString(this);
}
);
Expand Down Expand Up @@ -1165,7 +1165,7 @@ SnapExtensions.primitives.set(
'ide_hide(block)',
function (context, proc) {
var ide = this.parentThatIsA(IDE_Morph);
proc.assertType(context, ['command', 'reporter', 'predicate']);
proc.assertType(context, ['command', 'reporter', 'predicate', 'hat']);
this.changeBlockVisibility(context.expression, true);
ide.flushBlocksCache();
ide.refreshPalette();
Expand All @@ -1177,7 +1177,7 @@ SnapExtensions.primitives.set(
'ide_show(block)',
function (context, proc) {
var ide = this.parentThatIsA(IDE_Morph);
proc.assertType(context, ['command', 'reporter', 'predicate']);
proc.assertType(context, ['command', 'reporter', 'predicate', 'hat']);
this.changeBlockVisibility(context.expression, false);
ide.flushBlocksCache();
ide.refreshPalette();
Expand Down

0 comments on commit 69f452d

Please sign in to comment.