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

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

Issue 10534090: Rollback of r11719, r11717, r11716, r11714, r11700, r11699, r11697, r11695, r11694 in trunk branch. (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 8 years, 6 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 | « test/cctest/test-api.cc ('k') | test/mjsunit/override-read-only-property.js » ('j') | 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 7170ffd9c73e25980d3ebcb99638f1894fbf41f9..bb1ebf29db231a675264a10b94381c18a7c47faa 100644
--- a/test/mjsunit/harmony/proxies.js
+++ b/test/mjsunit/harmony/proxies.js
@@ -576,12 +576,12 @@ var rec
var key
var val
-function TestSetForDerived(trap) {
- TestWithProxies(TestSetForDerived2, trap)
+function TestSetForDerived(handler) {
+ TestWithProxies(TestSetForDerived2, handler)
}
-function TestSetForDerived2(create, trap) {
- var p = create({getPropertyDescriptor: trap, getOwnPropertyDescriptor: trap})
+function TestSetForDerived2(create, handler) {
+ var p = create(handler)
var o = Object.create(p, {x: {value: 88, writable: true},
'1': {value: 89, writable: true}})
@@ -608,13 +608,8 @@ function TestSetForDerived2(create, trap) {
assertEquals(45, o.p_nonwritable = 45)
assertEquals("p_nonwritable", key)
- assertFalse(Object.prototype.hasOwnProperty.call(o, "p_nonwritable"))
-
- assertThrows(function(){ "use strict"; o.p_nonwritable = 45 }, TypeError)
- assertEquals("p_nonwritable", key)
- assertFalse(Object.prototype.hasOwnProperty.call(o, "p_nonwritable"))
+ assertEquals(45, o.p_nonwritable)
- val = ""
assertEquals(46, o.p_setter = 46)
assertEquals("p_setter", key)
assertSame(o, rec)
@@ -631,29 +626,24 @@ function TestSetForDerived2(create, trap) {
assertThrows(function(){ "use strict"; o.p_nosetter = 50 }, TypeError)
assertEquals("p_nosetter", key)
assertEquals("", val) // not written at all
- assertFalse(Object.prototype.hasOwnProperty.call(o, "p_nosetter"));
assertThrows(function(){ o.p_nonconf = 53 }, TypeError)
assertEquals("p_nonconf", key)
- assertFalse(Object.prototype.hasOwnProperty.call(o, "p_nonconf"));
assertThrows(function(){ o.p_throw = 51 }, "myexn")
assertEquals("p_throw", key)
- assertFalse(Object.prototype.hasOwnProperty.call(o, "p_throw"));
assertThrows(function(){ o.p_setterthrow = 52 }, "myexn")
assertEquals("p_setterthrow", key)
- assertFalse(Object.prototype.hasOwnProperty.call(o, "p_setterthrow"));
}
-
-TestSetForDerived(
- function(k) {
+TestSetForDerived({
+ getPropertyDescriptor: function(k) {
key = k;
switch (k) {
case "p_writable": return {writable: true, configurable: true}
case "p_nonwritable": return {writable: false, configurable: true}
- case "p_setter": return {
+ case "p_setter":return {
set: function(x) { rec = this; val = x },
configurable: true
}
@@ -661,13 +651,13 @@ TestSetForDerived(
get: function() { return 1 },
configurable: true
}
- case "p_nonconf": return {}
+ case "p_nonconf":return {}
case "p_throw": throw "myexn"
case "p_setterthrow": return {set: function(x) { throw "myexn" }}
default: return undefined
}
}
-)
+})
// Evil proxy-induced side-effects shouldn't crash.
« no previous file with comments | « test/cctest/test-api.cc ('k') | test/mjsunit/override-read-only-property.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698