<html>
<head>
<script>
var local = 'FAIL: Access to the correct scope, but incorrect method.';

function f() {
  // Create an object literal.
  var literal = {};

  // Assign to foo on the Object prototype in the
  // context used to create the object literal.
  literal.__proto__.foo = function() {
    top.log(local);
  }
}

window.onload = function() {
  // Assign f to a variable in the outer frame so
  // it can be called after the source of the inner
  // frame has changed.
  top.set_function(f);
}
</script>
</head>
<body>
object-literals-same-origin
</body>
</html>

