Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: test/mjsunit/harmony/proxies.js

Issue 1543553002: [proxies] Adapt and reenable remaining tests in proxies.js (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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" }
}
}))
-*/
// ---------------------------------------------------------------------------
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698