Skip to content

Commit

Permalink
only bind rings that replace list items to the list as environment if…
Browse files Browse the repository at this point in the history
… they are referred to by a non-numerical index (OOP 2.0)
  • Loading branch information
jmoenig committed Oct 12, 2024
1 parent 8e51d29 commit 746a22c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Snap! (BYOB) History

## in development:
* **Notable Fixes:**
* only bind rings that replace list items to the list as environment if they are referred to by a non-numerical index (OOP 2.0)

### 2024-09-12
* threads: only bind rings replaced in a list to the list as environment if they are referred to by a non-numerical index (OOP 2.0)

## 10.1.1:
* **Notable Fixes:**
Expand Down
3 changes: 2 additions & 1 deletion src/threads.js
Original file line number Diff line number Diff line change
Expand Up @@ -2293,7 +2293,8 @@ Process.prototype.doReplaceInList = function (index, list, element) {
idx = 0;
}
}
if (element instanceof Context) { // OOP 2.0: treat ring as method
if (element instanceof Context && (parseFloat(idx) !== +idx)) {
// OOP 2.0: treat ring as method
element = this.reportContextFor(element, list);
}
list.bind(idx, element);
Expand Down

0 comments on commit 746a22c

Please sign in to comment.