Skip to content

Commit 6ac8e6a

Browse files
committed
fix: update std/map fixture so test passes with new Map constructor
1 parent 970fdb2 commit 6ac8e6a

File tree

4 files changed

+42600
-23343
lines changed

4 files changed

+42600
-23343
lines changed

std/assembly/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2406,7 +2406,7 @@ interface Map<K,V> {
24062406
toString(): string;
24072407
}
24082408

2409-
type MapInitialEntries<K,V> = {key: V, value:V}[]
2409+
type MapInitialEntries<K,V> = {key: K, value:V}[]
24102410

24112411
interface MapConstructor {
24122412
new <K, V>(entries?: MapInitialEntries<K,V>): Map<K,V>;

std/assembly/map.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ export class Map<K,V> {
7676
constructor(initialEntries: MapInitialEntries<K,V> = []) {
7777
let entriesLength = initialEntries.length;
7878

79-
if(entriesLength > 0) {
80-
if(entriesLength >= this.entriesCapacity) this.bucketsMask = entriesLength;
79+
if (entriesLength > 0) {
80+
if (entriesLength >= this.entriesCapacity) this.bucketsMask = entriesLength;
8181
this.rehash((this.bucketsMask << 1) | 1);
8282

83-
for(let i = 0; i < entriesLength; i++){
83+
for (let i = 0; i < entriesLength; i++) {
8484
let key = initialEntries[i].key;
8585
let value = initialEntries[i].value;
8686
let hashCode = HASH<K>(key);

0 commit comments

Comments
 (0)