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

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: Address comment Created 4 years, 11 months 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 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" }
}
}))
-*/
// ---------------------------------------------------------------------------
« 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