mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-22 19:21:47 +00:00
Filler implementation for std Set
This commit is contained in:
@ -4086,6 +4086,7 @@
|
||||
CLASS_PROTOTYPE: RegExp
|
||||
CLASS_PROTOTYPE: std:set/Set
|
||||
CLASS_PROTOTYPE: Set
|
||||
PROPERTY: std:set/Set#size
|
||||
GLOBAL: std:string/EMPTY
|
||||
CLASS_PROTOTYPE: std:string/String
|
||||
CLASS_PROTOTYPE: String
|
||||
|
@ -279,6 +279,7 @@
|
||||
CLASS_PROTOTYPE: RegExp
|
||||
CLASS_PROTOTYPE: std:set/Set
|
||||
CLASS_PROTOTYPE: Set
|
||||
PROPERTY: std:set/Set#size
|
||||
GLOBAL: std:string/EMPTY
|
||||
CLASS_PROTOTYPE: std:string/String
|
||||
CLASS_PROTOTYPE: String
|
||||
|
@ -2870,6 +2870,7 @@
|
||||
CLASS_PROTOTYPE: RegExp
|
||||
CLASS_PROTOTYPE: std:set/Set
|
||||
CLASS_PROTOTYPE: Set
|
||||
PROPERTY: std:set/Set#size
|
||||
GLOBAL: std:string/EMPTY
|
||||
CLASS_PROTOTYPE: std:string/String
|
||||
CLASS_PROTOTYPE: String
|
||||
|
2371
tests/compiler/std/set.optimized-inlined.wast
Normal file
2371
tests/compiler/std/set.optimized-inlined.wast
Normal file
File diff suppressed because it is too large
Load Diff
2365
tests/compiler/std/set.optimized.wast
Normal file
2365
tests/compiler/std/set.optimized.wast
Normal file
File diff suppressed because it is too large
Load Diff
28
tests/compiler/std/set.ts
Normal file
28
tests/compiler/std/set.ts
Normal file
@ -0,0 +1,28 @@
|
||||
// note that this doesn't test a real set implementation yet, see std/assembly/set.ts
|
||||
|
||||
var set = changetype<Set<i32>>(allocate_memory(sizeof<usize>() + 2 * sizeof<i32>()));
|
||||
|
||||
assert(set.size == 0);
|
||||
|
||||
set.add(1);
|
||||
set.add(0);
|
||||
set.add(2);
|
||||
|
||||
assert(set.size == 3);
|
||||
|
||||
assert(set.has(1));
|
||||
assert(set.has(0));
|
||||
assert(set.has(2));
|
||||
assert(!set.has(3));
|
||||
|
||||
set.delete(0);
|
||||
|
||||
assert(set.size == 2);
|
||||
assert(set.has(1));
|
||||
assert(!set.has(0));
|
||||
assert(set.has(2));
|
||||
|
||||
set.clear();
|
||||
|
||||
assert(set.size == 0);
|
||||
assert(!set.has(1));
|
2790
tests/compiler/std/set.wast
Normal file
2790
tests/compiler/std/set.wast
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user