Lines Matching full:symbol
38 return ["Symbol(66)", "Symbol()"].indexOf(s) >= 0;
44 function indirectSymbol() { return Symbol() }
48 symbols.push(Symbol())
49 symbols.push(Symbol(undefined))
50 symbols.push(Symbol("66"))
51 symbols.push(Symbol(66))
52 symbols.push(Symbol().valueOf())
59 assertThrows(function () { Symbol(Symbol()) }, TypeError)
60 assertThrows(function () { new Symbol(66) }, TypeError)
67 assertEquals("symbol", typeof symbols[i])
68 assertTrue(typeof symbols[i] === "symbol")
71 assertEquals("Symbol", %_ClassOf(Object(symbols[i])))
78 assertSame(Object.prototype, Symbol.prototype.__proto__)
79 assertSame(Symbol.prototype, Symbol().__proto__)
80 assertSame(Symbol.prototype, Object(Symbol()).__proto__)
82 assertSame(Symbol.prototype, symbols[i].__proto__)
89 assertSame(Function.prototype, Symbol.__proto__)
90 assertFalse(Object === Symbol.prototype.constructor)
91 assertFalse(Symbol === Object.prototype.constructor)
92 assertSame(Symbol, Symbol.prototype.constructor)
93 assertSame(Symbol, Symbol().__proto__.constructor)
94 assertSame(Symbol, Object(Symbol()).__proto__.constructor)
96 assertSame(Symbol, symbols[i].__proto__.constructor)
106 assertTrue(Symbol.prototype.valueOf.call(Object(symbols[i])) === symbols[i])
107 assertTrue(Symbol.prototype.valueOf.call(symbols[i]) === symbols[i])
122 isValidSymbolString(Symbol.prototype.toString.call(symbols[i])))
124 "[object Symbol]", Object.prototype.toString.call(symbols[i]))
161 // Every symbol should equal itself, and non-strictly equal its wrapper.
233 // Test Symbol wrapping/boxing over non-builtins.
234 Symbol.prototype.getThisProto = function () {
239 assertTrue(symbols[i].getThisProto() === Symbol.prototype)
332 assertEquals("symbol", typeof syms[i])
408 // but not between scavenges. This must also apply for symbol keys.
409 var key = Symbol("key");
456 var desc = Object.getOwnPropertyDescriptor(Symbol, name)
457 assertSame("symbol", typeof desc.value)
458 assertSame("Symbol(Symbol." + name + ")", desc.value.toString())
463 assertFalse(Symbol.for("Symbol." + name) === desc.value)
464 assertTrue(Symbol.keyFor(desc.value) === undefined)
471 var symbol1 = Symbol.for("x1")
472 var symbol2 = Symbol.for("x2")
475 assertSame(symbol1, Symbol.for("x1"))
476 assertSame(symbol2, Symbol.for("x2"))
477 assertSame("x1", Symbol.keyFor(symbol1))
478 assertSame("x2", Symbol.keyFor(symbol2))
480 assertSame(Symbol.for("1"), Symbol.for(1))
481 assertThrows(function() { Symbol.keyFor("bla") }, TypeError)
482 assertThrows(function() { Symbol.keyFor({}) }, TypeError)
485 assertFalse(Symbol === Realm.eval(realm, "Symbol"))
486 assertFalse(Symbol.for === Realm.eval(realm, "Symbol.for"))
487 assertFalse(Symbol.keyFor === Realm.eval(realm, "Symbol.keyFor"))
488 assertSame(Symbol.create, Realm.eval(realm, "Symbol.create"))
489 assertSame(Symbol.iterator, Realm.eval(realm, "Symbol.iterator"))
491 assertSame(symbol1, Realm.eval(realm, "Symbol.for")("x1"))
492 assertSame(symbol1, Realm.eval(realm, "Symbol.for('x1')"))
493 assertSame("x1", Realm.eval(realm, "Symbol.keyFor")(symbol1))
495 assertSame("x1", Realm.eval(realm, "Symbol.keyFor(Realm.shared)"))
497 var symbol3 = Realm.eval(realm, "Symbol.for('x3')")
500 assertSame(symbol3, Symbol.for("x3"))
501 assertSame("x3", Symbol.keyFor(symbol3))