blob: 69148fe0a0f119ecd33149898e17f1a239f0dc01 [file] [log] [blame]
Tests basic correctness of ES Set object
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS Set instanceof Set is false
PASS Set.prototype instanceof Set is false
PASS Set() instanceof Set threw exception TypeError: calling Set constructor without new is invalid.
PASS new Set() instanceof Set is true
PASS Set(null) instanceof Set threw exception TypeError: calling Set constructor without new is invalid.
PASS Set(undefined) instanceof Set threw exception TypeError: calling Set constructor without new is invalid.
PASS Set(undefined, undefined) instanceof Set threw exception TypeError: calling Set constructor without new is invalid.
PASS Set(null, undefined) instanceof Set threw exception TypeError: calling Set constructor without new is invalid.
PASS new Set(null) instanceof Set is true
PASS new Set(undefined) instanceof Set is true
PASS new Set(undefined, undefined) instanceof Set is true
PASS new Set(null, undefined) instanceof Set is true
PASS Set(1) threw exception TypeError: calling Set constructor without new is invalid.
PASS Set(true) threw exception TypeError: calling Set constructor without new is invalid.
PASS Set([]) threw exception TypeError: calling Set constructor without new is invalid.
PASS Set({}) threw exception TypeError: calling Set constructor without new is invalid.
PASS Set(undefined, null) threw exception TypeError: calling Set constructor without new is invalid.
PASS Set(undefined, {}) threw exception TypeError: calling Set constructor without new is invalid.
PASS new Set(1) threw exception TypeError: Type error.
PASS new Set(true) threw exception TypeError: Type error.
PASS new Set([]) did not throw exception.
PASS new Set({}) threw exception TypeError: Type error.
PASS new Set(undefined, null) did not throw exception.
PASS new Set(undefined, {}) did not throw exception.
1
undefined
true
6
1
0
[object Object]
PASS Object.hasOwnProperty(set, 'size') is false
PASS Set.prototype.hasOwnProperty('size') is true
PASS Set.prototype.size threw exception TypeError: Set operation called on non-Set object.
PASS Set.prototype.add.length is 1
PASS Set.prototype.has.length is 1
PASS Set.prototype.clear.length is 0
PASS Set.prototype.keys.length is 0
PASS Set.prototype.values.length is 0
PASS Set.prototype.entries.length is 0
PASS set.size is 0
PASS set.add(-0) is set
PASS set.add(0) is set
PASS set.size is 1
PASS set.add(Infinity) is set
PASS set.add(-Infinity) is set
PASS set.add(NaN) is set
PASS set.add('0') is set
PASS set.add(0.1) is set
PASS set.size is 6
PASS set.has(-0) is true
PASS set.has(0) is true
PASS set.has(Infinity) is true
PASS set.has(-Infinity) is true
PASS set.has(NaN) is true
PASS set.has('0') is true
PASS set.has(0.1) is true
PASS set.delete(-0) is true
PASS set.delete(0) is false
PASS set.delete(Infinity) is true
PASS set.delete(-Infinity) is true
PASS set.delete(NaN) is true
PASS set.delete('0') is true
PASS set.delete(0.1) is true
PASS set.delete(-0) is false
PASS set.delete(0) is false
PASS set.delete(Infinity) is false
PASS set.delete(-Infinity) is false
PASS set.delete(NaN) is false
PASS set.delete('0') is false
PASS set.delete(0.1) is false
PASS set.has(simpleString) is true
PASS set.has(otherString) is true
PASS set.clear() is undefined.
PASS set.size is 0
PASS set.add(0) is set
PASS set.add('0') is set
PASS set.add(1) is set
PASS set.add('1') is set
PASS set.add(2) is set
PASS set.add('2') is set
PASS set.add(3) is set
PASS set.add('3') is set
PASS set.add(4) is set
PASS set.add('4') is set
PASS set.add(5) is set
PASS set.add('5') is set
PASS set.add(6) is set
PASS set.add('6') is set
PASS set.size is 14
forEach #0
PASS testThis is undefined.
0
forEach #1
PASS testThis is thisValue
1
0
0
1
1
2
2
3
3
4
4
5
5
6
6
PASS set.forEach(debug) is undefined.
0 : number
0 : string
1 : number
1 : string
2 : number
2 : string
3 : string
4 : string
5 : number
5 : string
6 : number
6 : string
4 : number
PASS set.has(0) is true
PASS set.has("0") is true
PASS set.has(1) is true
PASS set.has("1") is true
PASS set.has("3") is true
PASS set.has("4") is true
PASS set.has(5) is true
PASS set.has("5") is true
PASS set.has(6) is true
PASS set.has("6") is true
PASS set.has(4) is true
set.@@iterator()
PASS key is 0
PASS key is '0'
PASS key is 1
PASS key is '1'
PASS key is 2
PASS key is '2'
PASS key is 3
PASS key is '3'
PASS key is 4
PASS key is '4'
PASS i is 10
set.entries()
PASS key is 0
PASS value is 0
PASS key is '0'
PASS value is '0'
PASS key is 1
PASS value is 1
PASS key is '1'
PASS value is '1'
PASS key is 2
PASS value is 2
PASS key is '2'
PASS value is '2'
PASS key is 3
PASS value is 3
PASS key is '3'
PASS value is '3'
PASS key is 4
PASS value is 4
PASS key is '4'
PASS value is '4'
PASS i is 10
set.keys()
PASS key is 0
PASS key is '0'
PASS key is 1
PASS key is '1'
PASS key is 2
PASS key is '2'
PASS key is 3
PASS key is '3'
PASS key is 4
PASS key is '4'
PASS i is 10
set.values()
PASS value is 0
PASS value is '0'
PASS value is 1
PASS value is '1'
PASS value is 2
PASS value is '2'
PASS value is 3
PASS value is '3'
PASS value is 4
PASS value is '4'
PASS i is 10
Set mutation with live iterator and GC
PASS key is 1
PASS key is 3
PASS key is 4
PASS key is 5
PASS key is 7
PASS i is 5
PASS set.size is 4
A dead iterator should remain dead
PASS count is 0
PASS count is 3
PASS count is 3
PASS successfullyParsed is true
TEST COMPLETE