blob: b7dda371dc5bb4257a1d11cbce6d5d99ed3556d8 [file] [log] [blame]
<html>
<head>
<script>
var local = "FAIL: Access to cross-origin scope.";
// Set a foo function on the object prototype.
Object.prototype.foo = function() {
top.postMessage('PASS: Called the correct method.', '*');
}
window.onload = function() {
top.postMessage('ready', '*');
}
window.addEventListener('message', function(e) {
// This call should always hit the function above, but
// using on object literal, we manage to overwrite it.
Object.prototype.foo();
top.postMessage('done', '*');
}, false);
</script>
</head>
<body>
object-literals-cross-origin
</body>
</html>