Author: hannes
Date: 2009-01-14 14:36:04 +0100 (Wed, 14 Jan 2009)
New Revision: 9481
Modified:
helma-ng/trunk/modules/helma/webapp/request.js
Log:
Remove complex getter code - this stuff is now implemented in Java (ParameterMap)
Details at http://dev.helma.org/trac/helma/changeset/9481
Modified: helma-ng/trunk/modules/helma/webapp/request.js
===================================================================
--- helma-ng/trunk/modules/helma/webapp/request.js 2009-01-14 13:36:02 UTC (rev 9480)
+++ helma-ng/trunk/modules/helma/webapp/request.js 2009-01-14 13:36:04 UTC (rev 9481)
@@ -8,44 +8,6 @@
(function() {
- function cachedGetter(name, fn) {
- return function() {
- // make sure to never set anything on request prototype
- if (this != Request.prototype) {
- var cache = this.__property_cache__;
- if (!cache) {
- cache = this.__property_cache__ = {};
- }
- if (!cache[name]) {
- cache[name] = fn.apply(this);
- }
- return cache[name];
- }
- };
- }
-
- function ParameterGroup(path, map) {
-
- for (var i in map) {
- if (i.startsWith(path)) {
- var dot = i.indexOf('.', path.length);
- var key, value;
- if (dot > -1) {
- key = i.slice(path.length, dot);
- value = new ParameterGroup(i.slice(0, dot + 1), map);
- } else {
- key = i.slice(path.length);
- value = map[i];
- }
- if (!this.hasOwnProperty(key)) {
- this[key] = value[0];
- }
- }
- }
-
- return this;
- }
-
/**
* Return true if this is a HTTP POST request.
*/
@@ -59,25 +21,5 @@
this.isGet = function() {
return this.method == "GET";
}
-
- /* this.__defineGetter__("cookies", cachedGetter('cookies',
- function() {
- var cookies = {};
- for each (var cookie in this.getCookies()) {
- cookies[cookie.name] = cookie.value;
- }
- return cookies;
- })
- ); */
-
- /* this.__defineGetter__("params", cachedGetter('params', function() {
- return new ParameterGroup("", this.getParameterMap());
- })
- ); */
-
- this.__defineGetter__("data", cachedGetter('data', function() {
- return new ParameterGroup("", this.getParameterMap());
- })
- );
}).apply(Request.prototype);
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.