blob: 48b6a8da7db33d883cd30c148c0f656530eba9a1 [file] [log] [blame]
This tests that you can't set the prototype of the window or location objects cross-origin using Object.setPrototypeOf()
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS: targetWindow instanceof Array should be 'false' and is.
PASS Object.setPrototypeOf(targetWindow, Array.prototype) threw exception TypeError: Cannot set prototype of immutable prototype object.
PASS: targetWindow instanceof Array should be 'false' and is.
PASS: targetWindow.location instanceof Array should be 'false' and is.
PASS Object.setPrototypeOf(targetWindow.location, Array.prototype) threw exception TypeError: Cannot set prototype of immutable prototype object.
PASS: targetWindow.location instanceof Array should be 'false' and is.
PASS: targetWindow instanceof Array should be 'false' and is.
PASS protoSetter.call(targetWindow, Array.prototype) threw exception TypeError: Cannot set prototype of immutable prototype object.
PASS: targetWindow instanceof Array should be 'false' and is.
PASS: targetWindow.location instanceof Array should be 'false' and is.
PASS protoSetter.call(targetWindow.location, Array.prototype) threw exception TypeError: Cannot set prototype of immutable prototype object.
PASS: targetWindow.location instanceof Array should be 'false' and is.
PASS: Object.getPrototypeOf(targetWindow) should be 'null' and is.
PASS Object.setPrototypeOf(targetWindow, null) did not throw exception.
PASS: Object.getPrototypeOf(targetWindow.location) should be 'null' and is.
PASS Object.setPrototypeOf(targetWindow.location, null) did not throw exception.
PASS: successfullyParsed should be 'true' and is.
TEST COMPLETE