From 746a22c2e48047d49c74be122db15097d9c88e6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20M=C3=B6nig?= Date: Sat, 12 Oct 2024 12:05:36 +0200 Subject: [PATCH] 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) --- HISTORY.md | 5 +++++ src/threads.js | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index eca780354..384470d69 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -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:** diff --git a/src/threads.js b/src/threads.js index fd6b73183..fabb29ff7 100644 --- a/src/threads.js +++ b/src/threads.js @@ -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);