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. |