r9570 - helma-ng/trunk/src/org/helma/javascript

[email protected]
Newsgroups gmane.comp.java.helma.cvs
Message-ID <20090403101332.C267B3D0D6@mia>
Author: hannes
Date: 2009-04-03 12:13:32 +0200 (Fri, 03 Apr 2009)
New Revision: 9570

Modified:
   helma-ng/trunk/src/org/helma/javascript/ModuleScope.java
Log:
Fix bug where the exports object in shared modules is not updated on re-evaluation.

Details at http://dev.helma.org/trac/helma/changeset/9570

Modified: helma-ng/trunk/src/org/helma/javascript/ModuleScope.java
===================================================================
--- helma-ng/trunk/src/org/helma/javascript/ModuleScope.java	2009-04-03 10:13:31 UTC (rev 9569)
+++ helma-ng/trunk/src/org/helma/javascript/ModuleScope.java	2009-04-03 10:13:32 UTC (rev 9570)
@@ -44,7 +44,7 @@
                 (Repository) source : source.getParentRepository();
         this.name = moduleName;
         this.exports = cx.newObject(this);
-        defineProperty("exports", exports,  DONTENUM | READONLY | PERMANENT);
+        defineProperty("exports", exports,  DONTENUM);
         defineProperty("__exports__", cx.newArray(this, 0), DONTENUM);
         defineProperty("__name__", moduleName, DONTENUM);
         defineProperty("__path__", source.getPath(), DONTENUM);
@@ -55,6 +55,8 @@
     }
 
     public void reset(Context cx) {
+        this.exports = cx.newObject(this);
+        defineProperty("exports", exports,  DONTENUM);
         delete("__shared__");     
         defineProperty("__exports__", cx.newArray(this, 0), DONTENUM);
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.