Lines Matching refs:symbols

30 var symbols = []  variable
48 symbols.push(Symbol())
49 symbols.push(Symbol(undefined))
50 symbols.push(Symbol("66"))
51 symbols.push(Symbol(66))
52 symbols.push(Symbol().valueOf())
53 symbols.push(indirect())
66 for (var i in symbols) {
67 assertEquals("symbol", typeof symbols[i])
68 assertTrue(typeof symbols[i] === "symbol")
69 assertFalse(%SymbolIsPrivate(symbols[i]))
70 assertEquals(null, %_ClassOf(symbols[i]))
71 assertEquals("Symbol", %_ClassOf(Object(symbols[i])))
81 for (var i in symbols) {
82 assertSame(Symbol.prototype, symbols[i].__proto__)
95 for (var i in symbols) {
96 assertSame(Symbol, symbols[i].__proto__.constructor)
103 for (var i in symbols) {
104 assertTrue(symbols[i] === Object(symbols[i]).valueOf())
105 assertTrue(symbols[i] === symbols[i].valueOf())
106 assertTrue(Symbol.prototype.valueOf.call(Object(symbols[i])) === symbols[i])
107 assertTrue(Symbol.prototype.valueOf.call(symbols[i]) === symbols[i])
114 for (var i in symbols) {
115 assertThrows(function() { new String(symbols[i]) }, TypeError)
116 assertEquals(symbols[i].toString(), String(symbols[i]))
117 assertThrows(function() { symbols[i] + "" }, TypeError)
118 assertThrows(function() { String(Object(symbols[i])) }, TypeError)
119 assertTrue(isValidSymbolString(symbols[i].toString()))
120 assertTrue(isValidSymbolString(Object(symbols[i]).toString()))
122 isValidSymbolString(Symbol.prototype.toString.call(symbols[i])))
124 "[object Symbol]", Object.prototype.toString.call(symbols[i]))
131 for (var i in symbols) {
132 assertTrue(Boolean(Object(symbols[i])))
133 assertFalse(!Object(symbols[i]))
134 assertTrue(Boolean(symbols[i]).valueOf())
135 assertFalse(!symbols[i])
136 assertTrue(!!symbols[i])
137 assertTrue(symbols[i] && true)
138 assertFalse(!symbols[i] && false)
139 assertTrue(!symbols[i] || true)
140 assertEquals(1, symbols[i] ? 1 : 2)
141 assertEquals(2, !symbols[i] ? 1 : 2)
142 if (!symbols[i]) assertUnreachable();
143 if (symbols[i]) {} else assertUnreachable();
150 for (var i in symbols) {
151 assertThrows(function() { Number(Object(symbols[i])) }, TypeError)
152 assertThrows(function() { +Object(symbols[i]) }, TypeError)
153 assertThrows(function() { Number(symbols[i]) }, TypeError)
154 assertThrows(function() { symbols[i] + 0 }, TypeError)
162 for (var i in symbols) {
163 assertSame(symbols[i], symbols[i])
164 assertEquals(symbols[i], symbols[i])
165 assertTrue(Object.is(symbols[i], symbols[i]))
166 assertTrue(symbols[i] === symbols[i])
167 assertTrue(symbols[i] == symbols[i])
168 assertFalse(symbols[i] === Object(symbols[i]))
169 assertFalse(Object(symbols[i]) === symbols[i])
170 assertTrue(symbols[i] == Object(symbols[i]))
171 assertTrue(Object(symbols[i]) == symbols[i])
172 assertTrue(symbols[i] === symbols[i].valueOf())
173 assertTrue(symbols[i].valueOf() === symbols[i])
174 assertTrue(symbols[i] == symbols[i].valueOf())
175 assertTrue(symbols[i].valueOf() == symbols[i])
176 assertFalse(Object(symbols[i]) === Object(symbols[i]))
177 assertEquals(Object(symbols[i]).valueOf(), Object(symbols[i]).valueOf())
181 for (var i = 0; i < symbols.length; ++i) {
182 for (var j = i + 1; j < symbols.length; ++j) {
183 assertFalse(Object.is(symbols[i], symbols[j]))
184 assertFalse(symbols[i] === symbols[j])
185 assertFalse(symbols[i] == symbols[j])
191 for (var i in symbols) {
193 assertFalse(symbols[i] === values[j])
194 assertFalse(values[j] === symbols[i])
195 assertFalse(symbols[i] == values[j])
196 assertFalse(values[j] == symbols[i])
204 for (var i in symbols) {
205 assertTrue(isValidSymbolString(symbols[i].toString()))
206 assertEquals(symbols[i], symbols[i].valueOf())
207 assertEquals(undefined, symbols[i].a)
208 assertEquals(undefined, symbols[i]["a" + "b"])
209 assertEquals(undefined, symbols[i]["" + "1"])
210 assertEquals(undefined, symbols[i][62])
217 for (var i in symbols) {
218 symbols[i].toString = 0
219 assertTrue(isValidSymbolString(symbols[i].toString()))
220 symbols[i].valueOf = 0
221 assertEquals(symbols[i], symbols[i].valueOf())
222 symbols[i].a = 0
223 assertEquals(undefined, symbols[i].a)
224 symbols[i]["a" + "b"] = 0
225 assertEquals(undefined, symbols[i]["a" + "b"])
226 symbols[i][62] = 0
227 assertEquals(undefined, symbols[i][62])
238 for (var i in symbols) {
239 assertTrue(symbols[i].getThisProto() === Symbol.prototype)
248 for (var i in symbols) {
249 set.add(symbols[i])
250 map.set(symbols[i], i)
252 assertEquals(symbols.length, set.size)
253 assertEquals(symbols.length, map.size)
254 for (var i in symbols) {
255 assertTrue(set.has(symbols[i]))
256 assertTrue(map.has(symbols[i]))
257 assertEquals(i, map.get(symbols[i]))
259 for (var i in symbols) {
260 assertTrue(set.delete(symbols[i]))
261 assertTrue(map.delete(symbols[i]))
273 for (var i = 0; i < symbols.length; i += 2) {
274 obj[symbols[i]] = i
283 for (var i = 1; i < symbols.length; i += 2) {
284 Object.defineProperty(obj, symbols[i], {value: i, configurable: true})
291 for (var i in symbols) {
292 assertEquals(i|0, obj[symbols[i]])
293 assertEquals(i|0, obj2[symbols[i]])
299 for (var i in symbols) {
300 assertTrue(symbols[i] in obj)
301 assertTrue(Object.hasOwnProperty.call(obj, symbols[i]))
325 assertEquals(syms.length, symbols.length)
333 for (var i in symbols) {
334 var desc = Object.getOwnPropertyDescriptor(obj, symbols[i])
340 Object.prototype.propertyIsEnumerable.call(obj, symbols[i]))
346 for (var i in symbols) {
347 delete obj[symbols[i]]
349 for (var i in symbols) {
350 assertEquals(undefined, Object.getOwnPropertyDescriptor(obj, symbols[i]))
373 for (var i in symbols) {
375 properties, symbols[i], {value: {value: i}, enumerable: i % 2 === 0})
378 for (var i in symbols) {
379 assertEquals(i % 2 === 0, symbols[i] in o)
387 for (var i in symbols) {
389 properties, symbols[i], {value: {value: i}, enumerable: i % 2 === 0})
392 for (var i in symbols) {
393 assertEquals(i % 2 === 0, symbols[i] in o)
418 var syms = symbols.slice(0, 30);
443 var symbols = [
449 for (var i in symbols) {
450 var name = symbols[i]