title: How can I add an object property to the global object in rhino javascript
body: <p>I have some properties in an object that I would like to add to the global namespace. In javascript on the browser I could just add it to the <code>window</code> object like so:</p>
  
  <pre><code>var myObject = {
    foo : function() {
      alert("hi");
    }
    // and many more properties
  };
  
  for (property in myObject) {
    window[property] = myObject[property];
  }
  
  // now I can just call foo()
  foo();
  </code></pre>
  
  <p>But since rhino doesn't have the global window object I can't do that. Is there an equivalent object or some other way to accomplish this?</p>