Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions std/assembly/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1535,7 +1535,7 @@ interface RegExp {}
declare class Map<K,V> {
readonly size: i32;
has(key: K): bool;
set(key: K, value: V): void;
set(key: K, value: V): this;
get(key: K): V;
delete(key: K): bool;
clear(): void;
Expand All @@ -1547,7 +1547,7 @@ declare class Map<K,V> {
declare class Set<K> {
readonly size: i32;
has(value: K): bool;
add(value: K): void;
add(value: K): this;
delete(value: K): bool;
clear(): void;
values(): K[]; // preliminary
Expand Down
3 changes: 2 additions & 1 deletion std/assembly/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class Map<K,V> {
}

@operator("[]=")
set(key: K, value: V): void {
set(key: K, value: V): this {
var hashCode = HASH<K>(key);
var entry = this.find(key, hashCode); // unmanaged!
if (entry) {
Expand Down Expand Up @@ -151,6 +151,7 @@ export class Map<K,V> {
entry.taggedNext = load<usize>(bucketPtrBase);
store<usize>(bucketPtrBase, changetype<usize>(entry));
}
return this;
}

delete(key: K): bool {
Expand Down
3 changes: 2 additions & 1 deletion std/assembly/set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export class Set<T> {
return this.find(key, HASH<T>(key)) !== null;
}

add(key: T): void {
add(key: T): this {
var hashCode = HASH<T>(key);
var entry = this.find(key, hashCode); // unmanaged!
if (!entry) {
Expand All @@ -124,6 +124,7 @@ export class Set<T> {
entry.taggedNext = load<usize>(bucketPtrBase);
store<usize>(bucketPtrBase, changetype<usize>(entry));
}
return this;
}

@operator("[]=")
Expand Down
Loading