Index: test/mjsunit/harmony/proxies.js |
diff --git a/test/mjsunit/harmony/proxies.js b/test/mjsunit/harmony/proxies.js |
index 69d1dea4bfbb953e68df5e58949456a799c312d1..42e4a9fce73b9f15e6785c6e1a4e7733e87b2adc 100644 |
--- a/test/mjsunit/harmony/proxies.js |
+++ b/test/mjsunit/harmony/proxies.js |
@@ -1325,30 +1325,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) |
} |
@@ -1371,15 +1369,15 @@ TestToString(new Proxy({}, { |
function TestToStringThrow(handler) { |
var p = new Proxy({}, handler) |
- assertEquals("[object Object]", Object.prototype.toString.call(p)) |
+ assertThrows(() => Object.prototype.toString.call(p)) |
Camillo Bruni
2015/12/21 12:50:04
Could you check explicitly for the thrown error?
|
assertThrows(function(){ Object.prototype.toLocaleString.call(p) }, "myexn") |
var f = new Proxy(function(){}, handler) |
- assertEquals("[object Function]", Object.prototype.toString.call(f)) |
+ assertThrows(() => Object.prototype.toString.call(f)) |
assertThrows(function(){ Object.prototype.toLocaleString.call(f) }, "myexn") |
var o = Object.create(p) |
- assertEquals("[object Object]", Object.prototype.toString.call(o)) |
+ assertThrows(() => Object.prototype.toString.call(o)) |
assertThrows(function(){ Object.prototype.toLocaleString.call(o) }, "myexn") |
} |
@@ -1388,10 +1386,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" } |
}) |
@@ -1405,7 +1399,6 @@ TestToStringThrow(new Proxy({}, { |
return function(r, k) { throw "myexn" } |
} |
})) |
-*/ |
// --------------------------------------------------------------------------- |