Lines Matching refs:symbols

30 var symbols = []  variable
46 symbols.push(%CreatePrivateSymbol("66"))
47 symbols.push(Object(%CreatePrivateSymbol("66")).valueOf())
56 for (var i in symbols) {
57 assertEquals("symbol", typeof symbols[i])
58 assertTrue(typeof symbols[i] === "symbol")
59 assertTrue(%SymbolIsPrivate(symbols[i]))
60 assertEquals(null, %_ClassOf(symbols[i]))
61 assertEquals("Symbol", %_ClassOf(Object(symbols[i])))
68 for (var i in symbols) {
69 assertSame(Symbol.prototype, symbols[i].__proto__)
76 for (var i in symbols) {
77 assertSame(Symbol, symbols[i].__proto__.constructor)
78 assertSame(Symbol, Object(symbols[i]).__proto__.constructor)
85 for (var i in symbols) {
86 assertThrows(function() {new String(symbols[i]) }, TypeError)
87 assertEquals(symbols[i].toString(), String(symbols[i]))
88 assertThrows(function() { symbols[i] + "" }, TypeError)
89 assertTrue(isValidSymbolString(symbols[i].toString()))
90 assertTrue(isValidSymbolString(Object(symbols[i]).toString()))
91 assertTrue(isValidSymbolString(Symbol.prototype.toString.call(symbols[i])))
93 "[object Symbol]", Object.prototype.toString.call(symbols[i]))
100 for (var i in symbols) {
101 assertTrue(Boolean(symbols[i]).valueOf())
102 assertFalse(!symbols[i])
103 assertTrue(!!symbols[i])
104 assertTrue(symbols[i] && true)
105 assertFalse(!symbols[i] && false)
106 assertTrue(!symbols[i] || true)
107 assertEquals(1, symbols[i] ? 1 : 2)
108 assertEquals(2, !symbols[i] ? 1 : 2)
109 if (!symbols[i]) assertUnreachable();
110 if (symbols[i]) {} else assertUnreachable();
117 for (var i in symbols) {
118 assertThrows(function() { Number(symbols[i]); }, TypeError);
119 assertThrows(function() { symbols[i] + 0; }, TypeError);
127 for (var i in symbols) {
128 assertSame(symbols[i], symbols[i])
129 assertEquals(symbols[i], symbols[i])
130 assertTrue(Object.is(symbols[i], symbols[i]))
131 assertTrue(symbols[i] === symbols[i])
132 assertTrue(symbols[i] == symbols[i])
133 assertFalse(symbols[i] === Object(symbols[i]))
134 assertFalse(Object(symbols[i]) === symbols[i])
135 assertTrue(symbols[i] == Object(symbols[i]))
136 assertTrue(Object(symbols[i]) == symbols[i])
137 assertTrue(symbols[i] === symbols[i].valueOf())
138 assertTrue(symbols[i].valueOf() === symbols[i])
139 assertTrue(symbols[i] == symbols[i].valueOf())
140 assertTrue(symbols[i].valueOf() == symbols[i])
144 for (var i = 0; i < symbols.length; ++i) {
145 for (var j = i + 1; j < symbols.length; ++j) {
146 assertFalse(Object.is(symbols[i], symbols[j]))
147 assertFalse(symbols[i] === symbols[j])
148 assertFalse(symbols[i] == symbols[j])
154 for (var i in symbols) {
156 assertFalse(symbols[i] === values[j])
157 assertFalse(values[j] === symbols[i])
158 assertFalse(symbols[i] == values[j])
159 assertFalse(values[j] == symbols[i])
167 for (var i in symbols) {
168 assertTrue(isValidSymbolString(symbols[i].toString()))
169 assertEquals(symbols[i], symbols[i].valueOf())
170 assertEquals(undefined, symbols[i].a)
171 assertEquals(undefined, symbols[i]["a" + "b"])
172 assertEquals(undefined, symbols[i]["" + "1"])
173 assertEquals(undefined, symbols[i][62])
180 for (var i in symbols) {
181 symbols[i].toString = 0
182 assertTrue(isValidSymbolString(symbols[i].toString()))
183 symbols[i].valueOf = 0
184 assertEquals(symbols[i], symbols[i].valueOf())
185 symbols[i].a = 0
186 assertEquals(undefined, symbols[i].a)
187 symbols[i]["a" + "b"] = 0
188 assertEquals(undefined, symbols[i]["a" + "b"])
189 symbols[i][62] = 0
190 assertEquals(undefined, symbols[i][62])
199 for (var i in symbols) {
200 set.add(symbols[i])
201 map.set(symbols[i], i)
203 assertEquals(symbols.length, set.size)
204 assertEquals(symbols.length, map.size)
205 for (var i in symbols) {
206 assertTrue(set.has(symbols[i]))
207 assertTrue(map.has(symbols[i]))
208 assertEquals(i, map.get(symbols[i]))
210 for (var i in symbols) {
211 assertTrue(set.delete(symbols[i]))
212 assertTrue(map.delete(symbols[i]))
224 for (var i = 0; i < symbols.length; i += 2) {
225 obj[symbols[i]] = i
234 for (var i = 1; i < symbols.length; i += 2) {
235 Object.defineProperty(obj, symbols[i], {value: i, configurable: true})
242 for (var i in symbols) {
243 assertEquals(i|0, obj[symbols[i]])
245 assertEquals(undefined, obj2[symbols[i]])
251 for (var i in symbols) {
252 assertTrue(symbols[i] in obj)
253 assertTrue(Object.hasOwnProperty.call(obj, symbols[i]))
276 for (var i in symbols) {
277 var desc = Object.getOwnPropertyDescriptor(obj, symbols[i]);
283 Object.prototype.propertyIsEnumerable.call(obj, symbols[i]))
289 for (var i in symbols) {
290 delete obj[symbols[i]]
292 for (var i in symbols) {
293 assertEquals(undefined, Object.getOwnPropertyDescriptor(obj, symbols[i]))