<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -146,23 +146,6 @@ var log = logging.getLogger(__name__);
                 });
             }
             return '&quot;' + x + '&quot;';
-        },
-
-        /*
-         * TODO this is a preliminary hack to support JSAdapter properties for the
-         * storable module. JSAdapters identify as functions with the typeof operator,
-         * and we use this to generate proxies in the DB representation of persistent
-         * object references. We need to find out how to implement this without
-         * messing with the main JSON module.
-         */
-        'function': function(x) {
-            if (x instanceof JSAdapter &amp;&amp; x._type &amp;&amp; typeof x.save == 'function') {
-                if (!x._id) {
-                    throw Error(&quot;Trying to save non-persistent property&quot;);
-                }
-                return '{&quot;_id&quot;: &quot;' + x._id + '&quot;, &quot;_type&quot;: &quot;' + x._type + '&quot;}'
-            }
-            return null;
         }
     };
 </diff>
      <filename>modules/core/JSON.js</filename>
    </modified>
    <modified>
      <diff>@@ -51,6 +51,7 @@ public class RhinoEngine {
     AppClassLoader                     loader             = new AppClassLoader();
     HelmaWrapFactory                   wrapFactory        = new HelmaWrapFactory();
     HelmaContextFactory                contextFactory     = new HelmaContextFactory(this);
+    ModuleScope                        mainScope          = null;
 
     public static final Object[]       EMPTY_ARGS         = new Object[0];
     protected boolean                  isInitialized      = false;
@@ -182,8 +183,8 @@ public class RhinoEngine {
             }
             ReloadableScript script = new ReloadableScript(resource, this);
             scripts.put(resource, script);
-            Scriptable scope = new ModuleScope(&quot;__main__&quot;, resource, topLevelScope);
-            retval = script.evaluate(scope, cx);
+            mainScope = new ModuleScope(&quot;__main__&quot;, resource, topLevelScope);
+            retval = script.evaluate(mainScope, cx);
         	if (retval instanceof Wrapper) {
         		return ((Wrapper) retval).unwrap();
         	}
@@ -250,7 +251,8 @@ public class RhinoEngine {
         try {
             Repository repository = repositories.get(0);
             Resource resource = repository.getResource(&quot;&lt;shell&gt;&quot;);
-            ModuleScope scope = new ModuleScope(&quot;&lt;shell&gt;&quot;, resource, topLevelScope);
+            Scriptable parentScope = mainScope != null ? mainScope : topLevelScope;
+            ModuleScope scope = new ModuleScope(&quot;&lt;shell&gt;&quot;, resource, parentScope);
             try {
                 getScript(&quot;helma.shell&quot;).evaluate(scope, cx);
             } catch (Exception x) {</diff>
      <filename>src/org/helma/javascript/RhinoEngine.java</filename>
    </modified>
    <modified>
      <diff>@@ -25,7 +25,6 @@ import org.mozilla.javascript.tools.ToolErrorReporter;
 
 import java.io.IOException;
 import java.io.PrintWriter;
-import java.io.FileNotFoundException;
 import java.util.Collections;
 import java.util.List;
 import java.util.regex.Matcher;</diff>
      <filename>src/org/helma/tools/HelmaShell.java</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>modules/helma/cache.js</filename>
    </removed>
    <removed>
      <filename>modules/helma/storage.js</filename>
    </removed>
    <removed>
      <filename>src/org/helma/storage/NotStorableException.java</filename>
    </removed>
    <removed>
      <filename>src/org/helma/storage/Storage.java</filename>
    </removed>
    <removed>
      <filename>src/org/helma/storage/file/FileStorage.java</filename>
    </removed>
    <removed>
      <filename>src/org/helma/storage/file/FileStorageTransaction.java</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>38e8e9cafb5edf9038c01757a8d71a5a89dd1cd5</id>
    </parent>
  </parents>
  <author>
    <name>Chris Zumbrunn</name>
    <email>chris@zumbrunn.com</email>
  </author>
  <url>http://github.com/zumbrunn/helma-ng/commit/02126dc362270def8389c988c2e3e6cfd17865d6</url>
  <id>02126dc362270def8389c988c2e3e6cfd17865d6</id>
  <committed-date>2008-09-05T09:47:14-07:00</committed-date>
  <authored-date>2008-09-05T09:47:14-07:00</authored-date>
  <message>Merge commit 'hns/master'</message>
  <tree>1176bc257573c9ccd978062367cdf2191cffa05d</tree>
  <committer>
    <name>Chris Zumbrunn</name>
    <email>chris@zumbrunn.com</email>
  </committer>
</commit>
