Filler implementation for std Set

This commit is contained in:
dcodeIO
2018-01-15 00:08:06 +01:00
parent 49d29fc9f2
commit f2ba4b4a76
13 changed files with 7637 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

28
tests/compiler/std/set.ts Normal file
View 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

File diff suppressed because it is too large Load Diff