[Helma-CVS] r9216 - in helma-ng/trunk: apps/demo apps/storage modules modules/core modules/helma modules/helma/simpleweb src/org/helma/javascript src/org/helma/repository src/org/helma/tools test test/core test/helma
hannes at helma.org
hannes at helma.org
Fri Sep 12 14:36:33 CEST 2008
Author: hannes
Date: 2008-09-12 14:36:32 +0200 (Fri, 12 Sep 2008)
New Revision: 9216
Added:
helma-ng/trunk/modules/global.js
Removed:
helma-ng/trunk/src/org/helma/javascript/GlobalFunctions.java
Modified:
helma-ng/trunk/apps/demo/main.js
helma-ng/trunk/apps/demo/webmodule.js
helma-ng/trunk/apps/storage/main.js
helma-ng/trunk/apps/storage/model.js
helma-ng/trunk/modules/core/JSON.js
helma-ng/trunk/modules/core/array.js
helma-ng/trunk/modules/core/date.js
helma-ng/trunk/modules/core/string.js
helma-ng/trunk/modules/helma/app.js
helma-ng/trunk/modules/helma/continuation.js
helma-ng/trunk/modules/helma/file.js
helma-ng/trunk/modules/helma/filestore.js
helma-ng/trunk/modules/helma/filters.js
helma-ng/trunk/modules/helma/http.js
helma-ng/trunk/modules/helma/jetty.js
helma-ng/trunk/modules/helma/logging.js
helma-ng/trunk/modules/helma/rhino.js
helma-ng/trunk/modules/helma/simpleweb.js
helma-ng/trunk/modules/helma/simpleweb/request.js
helma-ng/trunk/modules/helma/simpleweb/response.js
helma-ng/trunk/modules/helma/skin.js
helma-ng/trunk/modules/helma/unittest.js
helma-ng/trunk/src/org/helma/javascript/HelmaContextFactory.java
helma-ng/trunk/src/org/helma/javascript/ModuleScope.java
helma-ng/trunk/src/org/helma/javascript/ReloadableScript.java
helma-ng/trunk/src/org/helma/javascript/RhinoEngine.java
helma-ng/trunk/src/org/helma/repository/AbstractRepository.java
helma-ng/trunk/src/org/helma/repository/Repository.java
helma-ng/trunk/src/org/helma/tools/HelmaConfiguration.java
helma-ng/trunk/test/all.js
helma-ng/trunk/test/core/array_test.js
helma-ng/trunk/test/helma/file_test.js
helma-ng/trunk/test/helma/unittest_test.js
Log:
Implement global functions in JavaScript, renaming importModule(), importFromModule() and importJar() and introducing putThreadLocal() and getThreadLocal().
The global functions are now defined in file modules/global.js. The import* functions have been renamed and also implement different, simpler semantics.
importModule() has been renamed to loadModule() and no longer takes a second argument. Use an ordinary assignment instead:
// assign the module scope object to file
var file = loadModule('helma.file');
// use destructuring assignment to assign File property only
var {File} = loadModule('helma.file');
// use destructuring assignment to assign File to variable JSFile
var {File: JSFile} = loadModule('helma.file');
The new putThreadLocal() and getThreadLocal() functions allow to define variables in the global object only visible to the currently executing thread. The
variables can be accessed as ordinary global variables, or through getThreadLocal(name). If getThreadLocal() is called without argument, it returns the
thread-local scope object.
putThreadLocal("foo", "bar");
foo; // -> "bar"
getThreadLocal("foo"); // -> "bar"
getThreadLocal(); // -> ({foo:"bar"})
importJar() has been renamed to addToClasspath().
The JSAdapter constructor is no longer defined in the global scope as we have metamethods now.
getResources() has been fixed and now takes a second argument to retrieve resources from nested directories
More information about the Helma-CVS
mailing list