Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | // The argument to Set may contain a value multiple times. Duplicates are discarded. |
michael@0 | 2 | |
michael@0 | 3 | assertEq(Set(["testing", "testing", 123]).size, 2); |
michael@0 | 4 | |
michael@0 | 5 | var values = [undefined, null, false, NaN, 0, -0, 6.022e23, -Infinity, "", "xyzzy", {}, Math.sin]; |
michael@0 | 6 | for (let v of values) { |
michael@0 | 7 | var a = [v, {}, {}, {}, v, {}, v, v]; |
michael@0 | 8 | var s = Set(a); |
michael@0 | 9 | assertEq(s.size, 5); |
michael@0 | 10 | assertEq(s.has(v), true); |
michael@0 | 11 | } |