Index: test/mjsunit/harmony/proxies.js |
diff --git a/test/mjsunit/harmony/proxies.js b/test/mjsunit/harmony/proxies.js |
index bebe14e36da33496ea9ffbb1bc4f7ce2c0d5ded8..8f24d4d9add72bc838e3ddd6679761d3df7ea9f6 100644 |
--- a/test/mjsunit/harmony/proxies.js |
+++ b/test/mjsunit/harmony/proxies.js |
@@ -1265,30 +1265,28 @@ TestKeysThrow({ |
// Object.prototype.toLocaleString, |
// Function.prototype.toString) |
-//TODO(cbruni): enable once fixed. |
-/* |
var key |
function TestToString(handler) { |
var p = new Proxy({}, handler) |
key = "" |
assertEquals("[object Object]", Object.prototype.toString.call(p)) |
- assertEquals("", key) |
+ assertEquals(Symbol.toStringTag, key) |
assertEquals("my_proxy", Object.prototype.toLocaleString.call(p)) |
assertEquals("toString", key) |
- var f = new Proxy(handler, function() {}) |
+ var f = new Proxy(function() {}, handler) |
key = "" |
assertEquals("[object Function]", Object.prototype.toString.call(f)) |
- assertEquals("", key) |
+ assertEquals(Symbol.toStringTag, key) |
assertEquals("my_proxy", Object.prototype.toLocaleString.call(f)) |
assertEquals("toString", key) |
- assertDoesNotThrow(function(){ Function.prototype.toString.call(f) }) |
+ assertThrows(function(){ Function.prototype.toString.call(f) }) |
var o = Object.create(p) |
key = "" |
assertEquals("[object Object]", Object.prototype.toString.call(o)) |
- assertEquals("", key) |
+ assertEquals(Symbol.toStringTag, key) |
assertEquals("my_proxy", Object.prototype.toLocaleString.call(o)) |
assertEquals("toString", key) |
} |
@@ -1311,15 +1309,15 @@ TestToString(new Proxy({}, { |
function TestToStringThrow(handler) { |
var p = new Proxy({}, handler) |
- assertEquals("[object Object]", Object.prototype.toString.call(p)) |
+ assertThrowsEquals(() => Object.prototype.toString.call(p), "myexn") |
assertThrowsEquals(() => Object.prototype.toLocaleString.call(p), "myexn") |
var f = new Proxy(function(){}, handler) |
- assertEquals("[object Function]", Object.prototype.toString.call(f)) |
+ assertThrowsEquals(() => Object.prototype.toString.call(f), "myexn") |
assertThrowsEquals(() => Object.prototype.toLocaleString.call(f), "myexn") |
var o = Object.create(p) |
- assertEquals("[object Object]", Object.prototype.toString.call(o)) |
+ assertThrowsEquals(() => Object.prototype.toString.call(o), "myexn") |
assertThrowsEquals(() => Object.prototype.toLocaleString.call(o), "myexn") |
} |
@@ -1328,10 +1326,6 @@ TestToStringThrow({ |
}) |
TestToStringThrow({ |
- get: function(r, k) { return function() { throw "myexn" } } |
-}) |
- |
-TestToStringThrow({ |
get: function(r, k) { return this.get2(r, k) }, |
get2: function(r, k) { throw "myexn" } |
}) |
@@ -1345,7 +1339,6 @@ TestToStringThrow(new Proxy({}, { |
return function(r, k) { throw "myexn" } |
} |
})) |
-*/ |
// --------------------------------------------------------------------------- |