<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -13,11 +13,8 @@
  * functional and function-level programming.
  */
 
-// rhino compatibility
-typeof window == 'undefined' &amp;&amp; (window = {});
-
 /// `Functional` is the namespace for higher-order functions.
-var Functional = window.Functional || {};
+var Functional = this.Functional || {};
 
 /**
  * This function copies all the public functions in `Functional` except itself
@@ -27,12 +24,12 @@ var Functional = window.Functional || {};
  */
 Functional.install = function(except) {
     var source = Functional,
-        target = window;
+        target = (function() { return this; })();  // References the global object.
     for (var name in source)
         name == 'install'
         || name.charAt(0) == '_'
         || except &amp;&amp; name in except
-        || {}[name] // work around Prototype
+        || !source.hasOwnProperty(name) // work around Prototype
         || (target[name] = source[name]);
 }
 
@@ -781,12 +778,21 @@ Function.prototype.guard = function(guard, otherwise) {
  * This is useful for debugging function-level programs.
  */
 Function.prototype.traced = function(name) {
-    var self = this;
+    var self   = this,
+        global = (function() { return this; })(),
+        log    = function() {};
+
+    if (typeof console != 'undefined' &amp;&amp; typeof console.info == 'function') {
+      log = console.info;
+    } else if (typeof print == 'function') {
+      log = print;
+    }
+
     name = name || self;
     return function() {
-        window.console &amp;&amp; console.info('[', name, 'apply(', this!=window &amp;&amp; this, ',', arguments, ')');
+        log('[', name, 'apply(', this!=global &amp;&amp; this, ',', arguments, ')');
         var result = self.apply(this, arguments);
-        window.console &amp;&amp; console.info(']', name, ' -&gt; ', result);
+        log(']', name, ' -&gt; ', result);
         return result;
     }
 }
@@ -821,4 +827,4 @@ if (!Array.slice) { // mozilla already supports this
             return slice.apply(object, slice.call(arguments, 1));
         };
     })(Array.prototype.slice);
-}
\ No newline at end of file
+}</diff>
      <filename>functional.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>afee83486d0c84e03c26a974b708d7e54a4fd0ce</id>
    </parent>
  </parents>
  <author>
    <name>Jesse Hallett</name>
    <email>hallettj@gmail.com</email>
  </author>
  <url>http://github.com/osteele/functional-javascript/commit/8416cc0f9ef0a597bde7637b6abfd13deca683f9</url>
  <id>8416cc0f9ef0a597bde7637b6abfd13deca683f9</id>
  <committed-date>2009-04-08T13:16:08-07:00</committed-date>
  <authored-date>2009-04-08T13:16:08-07:00</authored-date>
  <message>Changes for compatibility with Spidermonkey shell:
* Factored out references to `window`.
* Use `print`, if available, for output in traced functions.
* Filter Object attributes with `hasOwnProperty` in Functional.install.</message>
  <tree>2b0a7d0d86e9e36a3cc18f9496f27b5cff888e89</tree>
  <committer>
    <name>Jesse Hallett</name>
    <email>hallettj@gmail.com</email>
  </committer>
</commit>
