Index: LayoutTests/fast/dom/Window/script-tests/postmessage-clone.js |
diff --git a/LayoutTests/fast/dom/Window/script-tests/postmessage-clone.js b/LayoutTests/fast/dom/Window/script-tests/postmessage-clone.js |
index 0a07d0408b76793cca4a6f0e5e11631145828cce..fa684cb3270d63ecf9a25026309cd1192a7e9288 100644 |
--- a/LayoutTests/fast/dom/Window/script-tests/postmessage-clone.js |
+++ b/LayoutTests/fast/dom/Window/script-tests/postmessage-clone.js |
@@ -154,13 +154,25 @@ tryPostMessage(thunk( |
doPassFail((v.b.p === 42 && v.a.p === 42) || |
(v.b.p === null && v.a.p === null), "accessors used (opposite order)"); |
}); |
-// We should nullify the results from accessors more than one level deep, |
-// but leave other fields untouched. |
+ |
+// Accessor properties (getters) are allowed on the cloned object, |
+// with no side conditions on the values they might return. For a |
+// short period, the spec mandated that accessor properties appearing |
+// within the value of what an 'outermost' accessor property returned |
+// should all map to null -- |
+// https://www.w3.org/Bugs/Public/show_bug.cgi?id=12101. This change |
+// was reverted and accessor properties were allowed with no spec |
+// restrictions on nesting. |
+// |
+// The tests below verify behavior surrounding such object structures, |
+// but the coercions to null must no longer happen. We keep |
+// the tests, as they usefully verify correctness in the handling of |
+// accessor properties overall. |
Mike West
2013/12/01 20:26:49
I'd suggest just adding something like "Verify tha
sof
2013/12/01 21:35:11
Done; indeed, information better kept with the com
|
tryPostMessage(thunk( |
'var obja = {get p() { return 42; }, q: 43}; ' + |
'return {get a() { return obja; }};' |
), false, "evalThunk", function(v) { |
- doPassFail(v.a.p === null, "accessor value was nullified"); |
+ doPassFail(v.a.p === 42, "accessor value was not nullified"); |
doPassFail(v.a.q === 43, "non-accessor value was not nullified"); |
}); |
tryPostMessage(thunk( |
@@ -168,10 +180,10 @@ tryPostMessage(thunk( |
'var obja = {get p() { return 42; }, q: 43, s: objb}; ' + |
'return {get a() { return obja; }};' |
), false, "evalThunk", function(v) { |
- doPassFail(v.a.p === null, "accessor value was nullified"); |
+ doPassFail(v.a.p === 42, "accessor value was not nullified"); |
doPassFail(v.a.q === 43, "non-accessor value was not nullified"); |
doPassFail(v.s !== null, "non-accessor value was not nullified"); |
- doPassFail(v.a.s.r === null, "accessor value was nullified"); |
+ doPassFail(v.a.s.r === 44, "accessor value was not nullified"); |
doPassFail(v.a.s.t === 45, "non-accessor value was not nullified"); |
}); |
tryPostMessage(thunk( |
@@ -181,13 +193,13 @@ tryPostMessage(thunk( |
), false, "evalThunk", function(v) { |
doPassFail(v.b === 46, "accessor value was not nullified"); |
doPassFail(v.c === 47, "accessor value was not nullified"); |
- doPassFail(v.a.p === null, "accessor value was nullified"); |
+ doPassFail(v.a.p === 42, "accessor value was not nullified"); |
doPassFail(v.a.q === 43, "non-accessor value was not nullified"); |
doPassFail(v.a.s !== null, "non-accessor value was not nullified"); |
doPassFail(v.a.s !== undefined, "non-accessor value is defined"); |
doPassFail(v.a.s[0] !== null, "non-accessor value was not nullified"); |
doPassFail(v.a.s[0] !== undefined, "non-accessor value is defined"); |
- doPassFail(v.a.s[0].r === null, "accessor value was nullified"); |
+ doPassFail(v.a.s[0].r === 44, "accessor value was not nullified"); |
doPassFail(v.a.s[0].t === 45, "non-accessor value was not nullified"); |
}); |
@@ -195,12 +207,10 @@ tryPostMessage(thunk( |
tryPostMessage(thunk( |
'return {get a() { throw "accessor-exn"; }};' |
), true, null, 'accessor-exn'); |
-// We should still return the exception raised from nulled-out accessors. |
tryPostMessage(thunk( |
'var obja = {get p() { throw "accessor-exn"; }}; ' + |
'return {get a() { return obja; }};' |
), true, null, 'accessor-exn'); |
-// We should run the first nullified accessor, but no more. |
tryPostMessage(thunk( |
'window.bcalled = undefined; ' + |
'window.acalled = undefined; ' + |
@@ -209,10 +219,10 @@ tryPostMessage(thunk( |
'var obja = {get a() { window.acalled = true; return objb; }}; ' + |
'return { get p() { window.pcalled = true; return obja; }};' |
), false, "evalThunk", function(v) { |
- doPassFail(v.p.a === null, "accessor value was nullified"); |
+ doPassFail(v.p.a.b === 42, "accessor value was not nullified"); |
doPassFail(window.pcalled === true, "window.pcalled === true"); |
doPassFail(window.acalled === true, "window.acalled === true"); |
- doPassFail(window.bcalled === undefined, "window.bcalled === undefined"); |
+ doPassFail(window.bcalled === true, "window.bcalled === true"); |
}); |
// Reference equality between Boolean objects must be maintained. |