| Index: test/mjsunit/harmony/private.js
|
| diff --git a/test/mjsunit/harmony/private.js b/test/mjsunit/harmony/private.js
|
| index 09cf7f74084082e36ab1d66391022985dffe492c..f5c3fcd7db77b3140fd79679b26ec7621799e3fe 100644
|
| --- a/test/mjsunit/harmony/private.js
|
| +++ b/test/mjsunit/harmony/private.js
|
| @@ -49,7 +49,6 @@ function TestType() {
|
| assertTrue(typeof symbols[i] === "symbol")
|
| assertTrue(%SymbolIsPrivate(symbols[i]))
|
| assertEquals(null, %_ClassOf(symbols[i]))
|
| - assertEquals("Symbol", %_ClassOf(new Symbol(symbols[i])))
|
| assertEquals("Symbol", %_ClassOf(Object(symbols[i])))
|
| }
|
| }
|
| @@ -67,27 +66,19 @@ TestPrototype()
|
| function TestConstructor() {
|
| for (var i in symbols) {
|
| assertSame(Symbol, symbols[i].__proto__.constructor)
|
| + assertSame(Symbol, Object(symbols[i]).__proto__.constructor)
|
| }
|
| }
|
| TestConstructor()
|
|
|
|
|
| -function TestName() {
|
| - for (var i in symbols) {
|
| - var name = symbols[i].name
|
| - assertTrue(name === "66")
|
| - }
|
| -}
|
| -TestName()
|
| -
|
| -
|
| function TestToString() {
|
| for (var i in symbols) {
|
| assertThrows(function() { String(symbols[i]) }, TypeError)
|
| assertThrows(function() { symbols[i] + "" }, TypeError)
|
| - assertThrows(function() { symbols[i].toString() }, TypeError)
|
| - assertThrows(function() { (new Symbol(symbols[i])).toString() }, TypeError)
|
| - assertThrows(function() { Object(symbols[i]).toString() }, TypeError)
|
| + assertDoesNotThrow(function() { symbols[i].toString() })
|
| + assertDoesNotThrow(function() { Object(symbols[i]).toString() })
|
| + assertThrows(function() { Symbol.prototype.toString.call(symbols[i]) })
|
| assertEquals("[object Symbol]", Object.prototype.toString.call(symbols[i]))
|
| }
|
| }
|
| @@ -128,10 +119,10 @@ function TestEquality() {
|
| assertTrue(Object.is(symbols[i], symbols[i]))
|
| assertTrue(symbols[i] === symbols[i])
|
| assertTrue(symbols[i] == symbols[i])
|
| - assertFalse(symbols[i] === new Symbol(symbols[i]))
|
| - assertFalse(new Symbol(symbols[i]) === symbols[i])
|
| - assertTrue(symbols[i] == new Symbol(symbols[i]))
|
| - assertTrue(new Symbol(symbols[i]) == symbols[i])
|
| + assertTrue(symbols[i] === symbols[i].valueOf())
|
| + assertTrue(symbols[i].valueOf() === symbols[i])
|
| + assertTrue(symbols[i] == symbols[i].valueOf())
|
| + assertTrue(symbols[i].valueOf() == symbols[i])
|
| }
|
|
|
| // All symbols should be distinct.
|
| @@ -159,7 +150,7 @@ TestEquality()
|
|
|
| function TestGet() {
|
| for (var i in symbols) {
|
| - assertThrows(function() { symbols[i].toString() }, TypeError)
|
| + assertDoesNotThrow(function() { symbols[i].toString() })
|
| assertEquals(symbols[i], symbols[i].valueOf())
|
| assertEquals(undefined, symbols[i].a)
|
| assertEquals(undefined, symbols[i]["a" + "b"])
|
| @@ -173,7 +164,7 @@ TestGet()
|
| function TestSet() {
|
| for (var i in symbols) {
|
| symbols[i].toString = 0
|
| - assertThrows(function() { symbols[i].toString() }, TypeError)
|
| + assertDoesNotThrow(function() { symbols[i].toString() })
|
| symbols[i].valueOf = 0
|
| assertEquals(symbols[i], symbols[i].valueOf())
|
| symbols[i].a = 0
|
|
|