@fable-org/fable-library-js 2.7.1 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -1
- package/CollectionUtil.js +10 -16
- package/MutableMap.js +5 -1
- package/MutableSet.js +5 -1
- package/Util.js +15 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
last_commit_released:
|
|
2
|
+
last_commit_released: 2369fbd24fafe851544c1ed6eb54f0bfc2b75f36
|
|
3
3
|
updaters:
|
|
4
4
|
- package.json:
|
|
5
5
|
file: package.json
|
|
@@ -15,6 +15,19 @@ All notable changes to this project will be documented in this file.
|
|
|
15
15
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
16
16
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
17
17
|
|
|
18
|
+
## 2.8.0 - 2026-09-25
|
|
19
|
+
|
|
20
|
+
### 🐞 Bug Fixes
|
|
21
|
+
|
|
22
|
+
* *(js/ts)* Fix Dictionary.Remove and HashSet.Remove to remove empty buckets (#4985) ([aea61b56](https://github.com/fable-compiler/Fable/commit/aea61b562c461a9b383e805f06f68a3b21ed45c2))
|
|
23
|
+
* *(js/ts)* Clear custom System.Collections.IList implementations ([2369fbd2](https://github.com/fable-compiler/Fable/commit/2369fbd24fafe851544c1ed6eb54f0bfc2b75f36))
|
|
24
|
+
|
|
25
|
+
### ⚡ Performance Improvements
|
|
26
|
+
|
|
27
|
+
* *(js/ts)* Faster `resizeArray.Clear()` in JS/TS ([32d85add](https://github.com/fable-compiler/Fable/commit/32d85add01422547dba03b15e0a0787d8afb031b))
|
|
28
|
+
|
|
29
|
+
<strong><small>[View changes on Github](https://github.com/fable-compiler/Fable/compare/4a441b1926387a42db6a3a4294acd97b02760ca3..2369fbd24fafe851544c1ed6eb54f0bfc2b75f36)</small></strong>
|
|
30
|
+
|
|
18
31
|
## 2.7.1 - 2026-09-11
|
|
19
32
|
|
|
20
33
|
### 🐞 Bug Fixes
|
package/CollectionUtil.js
CHANGED
|
@@ -161,22 +161,16 @@ export function clear(col) {
|
|
|
161
161
|
if (typeof col["System.Collections.Generic.ICollection`1.Clear"] === "function") {
|
|
162
162
|
return col["System.Collections.Generic.ICollection`1.Clear"](); // collection
|
|
163
163
|
}
|
|
164
|
+
else if (Array.isArray(col)) {
|
|
165
|
+
col.length = 0;
|
|
166
|
+
}
|
|
167
|
+
else if (ArrayBuffer.isView(col)) {
|
|
168
|
+
// TODO: throw for typed arrays?
|
|
169
|
+
}
|
|
170
|
+
else if (typeof col.clear === "function") {
|
|
171
|
+
col.clear(); // map, set
|
|
172
|
+
}
|
|
164
173
|
else {
|
|
165
|
-
|
|
166
|
-
if (ArrayBuffer.isView(col)) {
|
|
167
|
-
// TODO: throw for typed arrays?
|
|
168
|
-
}
|
|
169
|
-
else {
|
|
170
|
-
col.splice(0); // array, resize array
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
else {
|
|
174
|
-
if (typeof col.clear === "function") {
|
|
175
|
-
col.clear(); // map, set
|
|
176
|
-
}
|
|
177
|
-
else {
|
|
178
|
-
// TODO: throw for other collections?
|
|
179
|
-
}
|
|
180
|
-
}
|
|
174
|
+
// TODO: throw for other collections?
|
|
181
175
|
}
|
|
182
176
|
}
|
package/MutableMap.js
CHANGED
|
@@ -330,7 +330,11 @@ export function Dictionary__Remove_2B595(this$, k) {
|
|
|
330
330
|
}
|
|
331
331
|
switch (matchResult) {
|
|
332
332
|
case 0: {
|
|
333
|
-
|
|
333
|
+
const h_1 = matchValue[1] | 0;
|
|
334
|
+
getItemFromDict(this$.hashMap, h_1).splice(matchValue[2], 1);
|
|
335
|
+
if (getItemFromDict(this$.hashMap, h_1).length === 0) {
|
|
336
|
+
this$.hashMap.delete(h_1);
|
|
337
|
+
}
|
|
334
338
|
return true;
|
|
335
339
|
}
|
|
336
340
|
default:
|
package/MutableSet.js
CHANGED
|
@@ -224,7 +224,11 @@ export function HashSet__Remove_2B595(this$, k) {
|
|
|
224
224
|
}
|
|
225
225
|
switch (matchResult) {
|
|
226
226
|
case 0: {
|
|
227
|
-
|
|
227
|
+
const h_1 = matchValue[1] | 0;
|
|
228
|
+
getItemFromDict(this$.hashMap, h_1).splice(matchValue[2], 1);
|
|
229
|
+
if (getItemFromDict(this$.hashMap, h_1).length === 0) {
|
|
230
|
+
this$.hashMap.delete(h_1);
|
|
231
|
+
}
|
|
228
232
|
return true;
|
|
229
233
|
}
|
|
230
234
|
default:
|
package/Util.js
CHANGED
|
@@ -559,11 +559,23 @@ export function count(col) {
|
|
|
559
559
|
}
|
|
560
560
|
}
|
|
561
561
|
export function clear(col) {
|
|
562
|
-
if (
|
|
563
|
-
col.
|
|
562
|
+
if (Array.isArray(col)) {
|
|
563
|
+
col.length = 0;
|
|
564
|
+
}
|
|
565
|
+
else if (ArrayBuffer.isView(col)) {
|
|
566
|
+
// TODO: throw for typed arrays?
|
|
567
|
+
}
|
|
568
|
+
else if (typeof col.clear === "function") {
|
|
569
|
+
col.clear(); // map, set
|
|
570
|
+
}
|
|
571
|
+
else if (typeof col["System.Collections.Generic.ICollection`1.Clear"] === "function") {
|
|
572
|
+
col["System.Collections.Generic.ICollection`1.Clear"](); // collection
|
|
573
|
+
}
|
|
574
|
+
else if (typeof col["System.Collections.IList.Clear"] === "function") {
|
|
575
|
+
col["System.Collections.IList.Clear"](); // collection
|
|
564
576
|
}
|
|
565
577
|
else {
|
|
566
|
-
|
|
578
|
+
// TODO: throw for other collections?
|
|
567
579
|
}
|
|
568
580
|
}
|
|
569
581
|
const curried = new WeakMap();
|
package/package.json
CHANGED