Author: reebalazs
Date: Mon Jun 11 16:08:40 2007
New Revision: 44141

Modified:
   kukit/kukit.js/branch/ree-stripout-comments/kukit/actionreg.js
   kukit/kukit.js/branch/ree-stripout-comments/kukit/commandprocessor.js
   kukit/kukit.js/branch/ree-stripout-comments/kukit/dom.js
   kukit/kukit.js/branch/ree-stripout-comments/kukit/eventreg.js
   kukit/kukit.js/branch/ree-stripout-comments/kukit/forms.js
   kukit/kukit.js/branch/ree-stripout-comments/kukit/kssparser.js
   kukit/kukit.js/branch/ree-stripout-comments/kukit/kukit.js
   kukit/kukit.js/branch/ree-stripout-comments/kukit/oper.js
   kukit/kukit.js/branch/ree-stripout-comments/kukit/plugin.js
   kukit/kukit.js/branch/ree-stripout-comments/kukit/providerreg.js
   kukit/kukit.js/branch/ree-stripout-comments/kukit/resourcedata.js
   kukit/kukit.js/branch/ree-stripout-comments/kukit/selectorreg.js
   kukit/kukit.js/branch/ree-stripout-comments/kukit/serveraction.js
   kukit/kukit.js/branch/ree-stripout-comments/kukit/tokenizer.js
   kukit/kukit.js/branch/ree-stripout-comments/kukit/utils.js
Log:
Clean up commentification by removing ambigous use of multiline comments

Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/actionreg.js
==============================================================================
--- kukit/kukit.js/branch/ree-stripout-comments/kukit/actionreg.js      
(original)
+++ kukit/kukit.js/branch/ree-stripout-comments/kukit/actionreg.js      Mon Jun 
11 16:08:40 2007
@@ -52,9 +52,9 @@
     var func = this.content[name];
     if (! func) {
         // not found
-        ;;; throw 'Error : undefined local action "' + name + '"';
-        throw 'E';
-        //kukit.logError('Error : undefined action ' + name);
+        ;;; kukit.E = 'Error : undefined local action "' + name + '"';
+        throw kukit.E;
+        //kukit.logError(kukit.E);
         }
     return func;
 };

Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/commandprocessor.js
==============================================================================
--- kukit/kukit.js/branch/ree-stripout-comments/kukit/commandprocessor.js       
(original)
+++ kukit/kukit.js/branch/ree-stripout-comments/kukit/commandprocessor.js       
Mon Jun 11 16:08:40 2007
@@ -41,8 +41,8 @@
         // we make sure we execute none of them.
         var lastcommand = this.commands[this.commands.length-1];
         if (lastcommand.name == 'error') {
-            ;;; throw new kukit.err.ExplicitError(lastcommand);
-            throw 'E';
+            ;;; kukit.E = new kukit.err.ExplicitError(lastcommand);
+            throw kukit.E;
         }
     }
 };

Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/dom.js
==============================================================================
--- kukit/kukit.js/branch/ree-stripout-comments/kukit/dom.js    (original)
+++ kukit/kukit.js/branch/ree-stripout-comments/kukit/dom.js    Mon Jun 11 
16:08:40 2007
@@ -125,8 +125,8 @@
 kukit.dom.cssQuery = function(selector, in_nodes) {
     // to eliminate possible errors
     if (typeof(in_nodes) != 'undefined' && in_nodes == null) {
-        ;;; throw 'Selection error in kukit.dom.cssQuery';
-        throw 'E';
+        ;;; kukit.E = 'Selection error in kukit.dom.cssQuery';
+        throw kukit.E;
     }
     return kukit.dom._cssQuery(selector, in_nodes);
 };

Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/eventreg.js
==============================================================================
--- kukit/kukit.js/branch/ree-stripout-comments/kukit/eventreg.js       
(original)
+++ kukit/kukit.js/branch/ree-stripout-comments/kukit/eventreg.js       Mon Jun 
11 16:08:40 2007
@@ -48,8 +48,8 @@
 
 kukit.er.EventRegistry.prototype.registerBinder = function(classname, func) {
     if (typeof(func) == 'undefined') {
-        ;;; throw 'func argument is mandatory when registering an event binder 
(EventRegistry.registerBinder).';
-        throw 'E';
+        ;;; kukit.E = 'func argument is mandatory when registering an event 
binder (EventRegistry.registerBinder).';
+        throw kukit.E;
     }
     if (this.classes[classname]) {
         // Do not allow redefinition
@@ -71,8 +71,8 @@
     var func = this.classes[classname];
     if (! func) {
         // not found
-        ;;; throw 'Error : undefined event setup type ' + classname;
-        throw 'E';
+        ;;; kukit.E = 'Error : undefined event setup type ' + classname;
+        throw kukit.E;
         }
     return func;
 };
@@ -82,8 +82,8 @@
 kukit.er.EventRegistry.prototype._register = function(namespace, eventname, 
klass,
         bindmethodname, defaultactionmethodname, itername) {
     if (typeof(defaultactionmethodname) == 'undefined') {
-        ;;; throw 'some arguments are not passed when calling 
EventRegistry.register';
-        throw 'E';
+        ;;; kukit.E = 'some arguments are not passed when calling 
EventRegistry.register';
+        throw kukit.E;
     }
     // Find out the class name. (Not specified now.)
     var classname = klass.prototype.__classname__;
@@ -95,8 +95,8 @@
         klass.prototype.__classname__ = classname;
     }
     if (!eventname) {
-        ;;; throw 'eventname argument cannot be empty when registering an 
event (EventRegistry.register)';
-        throw 'E';
+        ;;; kukit.E = 'eventname argument cannot be empty when registering an 
event (EventRegistry.register)';
+        throw kukit.E;
     }
     var key = this._getKey(namespace, eventname);
     var entry = this.content[key];
@@ -104,22 +104,24 @@
         if (key[0] == '-') {
             key = key.substring(1);
         }
-        ;;; throw 'In EventRegistry.register double registration of key "' + 
key + '"';
-        throw 'E';
+        ;;; kukit.E = 'In EventRegistry.register double registration of key "' 
+ key + '"';
+        throw kukit.E;
     }
     // check bindmethodname and defaultactionmethodname
     if (bindmethodname && ! klass.prototype[bindmethodname]) {
-        ;;; throw 'In EventRegistry.register bind method "' + bindmethodname + 
'" is undefined for event "' + eventname + '" namespace "' + namespace + '"';
-        throw 'E';
+        ;;; kukit.E = 'In EventRegistry.register bind method "' + 
bindmethodname;
+        ;;; kukit.E += '" is undefined for event "' + eventname + '" namespace 
"' + namespace + '"';
+        throw kukit.E;
     }
     if (defaultactionmethodname && ! klass.prototype[defaultactionmethodname]) 
{
-        ;;; throw 'In EventRegistry.register default action method "' + 
defaultactionmethodname + '" is undefined for event "' + eventname + '" 
namespace "' + namespace + '"';
-        throw 'E';
+        ;;; kukit.E = 'In EventRegistry.register default action method "' + 
defaultactionmethodname;
+        ;;; kukit.E += '" is undefined for event "' + eventname + '" namespace 
"' + namespace + '"';
+        throw kukit.E;
     }
     // check the iterator.
     if  (! kukit.er.getBindIterator(itername)) {
-        ;;; throw 'In EventRegistry.register unknown bind iterator "' + 
itername + '"';
-        throw 'E';
+        ;;; kukit.E = 'In EventRegistry.register unknown bind iterator "' + 
itername + '"';
+        throw kukit.E;
     }
     // register it
     this.content[key] = {
@@ -167,8 +169,8 @@
     if (namespace == null) {
         namespace = '';
     } else if (namespace.split('-') > 1) {
-        ;;; throw 'In EventRegistry.register namespace cannot contain -';
-        throw 'E';
+        ;;; kukit.E = 'In EventRegistry.register namespace cannot contain -';
+        throw kukit.E;
     }
     return namespace + '-' + eventname;
 };
@@ -183,13 +185,14 @@
     var key = this._getKey(namespace, eventname);
     var entry = this.content[key];
     if (typeof(entry) == 'undefined') {
-        if (key[0] == '-') {
-            key = key.substring(1);
-            ;;; throw 'Error : undefined global event key ' + key + ' (or 
maybe namespace is missing?)';
-            throw 'E';
+        if (key.substr(0, 1) == '-') {
+            ;;; key = key.substring(1);
+            ;;; kukit.E = 'Error : undefined global event key ';
+            ;;; kukit.E += key + ' (or maybe namespace is missing?)';
+            throw kukit.E;
         } else {
-            ;;; throw 'Error : undefined event key ' + key;
-            throw 'E';
+            ;;; kukit.E = 'Error : undefined event key ' + key;
+            throw kukit.E;
         }
     } 
     return entry;
@@ -393,8 +396,10 @@
         if (! success) {
             // instead of the standard message give more specific reason:
             // either way we should have executed something...
-            ;;; throw 'Could not trigger event name "' + name + '" on 
namespace "' + namespace + '", because there is neither an explicit kss rule, 
nor a default method';
-            throw 'E';
+            ;;; kukit.E = 'Could not trigger event name "' + name;
+            ;;; kukit.E += '" on namespace "' + namespace;
+            ;;; kukit.E += '", because there is neither an explicit kss rule, 
nor a default method';
+            throw kukit.E;
         }
     }
 };
@@ -406,8 +411,10 @@
     // (called from oper)
     var method = this[methodname];
     if (! method) {
-        ;;; throw 'Could not trigger event name "' + name + '" on namespace "' 
+ namespace + '", because the method "' + methodname + '" does not exist.';
-        throw 'E';
+        ;;; kukit.E = 'Could not trigger event name "' + name;
+        ;;; kukit.E += '" on namespace "' + namespace;
+        ;;; kukit.E += '", because the method "' + methodname + '" does not 
exist.';
+        throw kukit.E;
     }
     // call it
     oper.binderinstance = this;
@@ -452,8 +459,9 @@
         //binderinstance.__bound_rules__ = [];
     } else if (binderinfo.getBinderInstance().__binder_classname__ != 
classname) {
         // just paranoia
-        ;;; throw 'Conflicting class for event id "' + id + '", "' + 
binderinfo.getBinderInstance().__binder_classname__ + '" != "' + classname + 
'"';
-        throw 'E';
+        ;;; kukit.E = 'Conflicting class for event id "' + id + '", "';
+        ;;; kukit.E += binderinfo.getBinderInstance().__binder_classname__ + 
'" != "' + classname + '"';
+        throw kukit.E;
     }
     return binderinfo;
 };
@@ -462,8 +470,8 @@
     // Get an event.
     var binderinfo = this.info[id];
     if (typeof(binderinfo) == 'undefined') {
-        ;;; throw 'Event with id "' + id + '" not found.';
-        throw 'E';
+        ;;; kukit.E = 'Event with id "' + id + '" not found.';
+        throw kukit.E;
     }
     return binderinfo;
 };
@@ -475,8 +483,9 @@
     var id = kukit.rd.makeId(namespace, classname);
     var binderinfo = this.info[id];
     if (typeof(binderinfo) == 'undefined') {
-        ;;; throw 'Singleton event with namespace "' + namespace + '" and 
(event) name "' + name + '" not found.';
-        throw 'E';
+        ;;; kukit.E = 'Singleton event with namespace "' + namespace;
+        ;;; kukit.E += '" and (event) name "' + name + '" not found.';
+        throw kukit.E;
     }
     return binderinfo;
 };
@@ -590,8 +599,8 @@
         // Create an empty list.
         rules_per_name = info[name] = {};
     } else if (typeof(rules_per_name[nodehash]) != 'undefined') {
-        ;;; throw 'Mismatch in bind registry, ' + name + ' already bound to 
node in this instance.'; 
-        throw 'E';
+        ;;; kukit.E = 'Mismatch in bind registry, ' + name + ' already bound 
to node in this instance.'; 
+        throw kukit.E;
     }
     return rules_per_name;
 };

Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/forms.js
==============================================================================
--- kukit/kukit.js/branch/ree-stripout-comments/kukit/forms.js  (original)
+++ kukit/kukit.js/branch/ree-stripout-comments/kukit/forms.js  Mon Jun 11 
16:08:40 2007
@@ -247,8 +247,8 @@
 kukit.fo.FieldUpdateRegistry.prototype.register = function(node, editor) {
     var hash = kukit.rd.hashnode(node);
     if (typeof(this.editors[hash]) != 'undefined') {
-    ;;;     throw 'Double registration of editor update on node.';
-        throw 'E';
+        ;;; kukit.E = 'Double registration of editor update on node.';
+        throw kukit.E;
     }
     this.editors[hash] = editor;
     //kukit.logDebug('Registered '+node.name + ' hash=' + hash);

Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/kssparser.js
==============================================================================
--- kukit/kukit.js/branch/ree-stripout-comments/kukit/kssparser.js      
(original)
+++ kukit/kukit.js/branch/ree-stripout-comments/kukit/kssparser.js      Mon Jun 
11 16:08:40 2007
@@ -74,13 +74,10 @@
         // We have evt- parms in the rule.
         if (block.evt_name != parser.kssSelector.name || block.evt_namespace 
!= parser.kssSelector.namespace) {
             // XXX this should be done in another way, so that we can see 
where the error happened.
-            /*
-            ;;; */
-            block.emitError('kss param key evt-[<namespace>-]<name>-yyy must 
not have different [namespace and] name then the kss selector at the top of the 
rule, "' 
-                    + key + '", and inside we have "' + block.evt_namespace + 
'-' + block.evt_name + '"');
-            ;;; /*
-            */
-            block.emitError('');
+            ;;; kukit.E = 'kss param key evt-[<namespace>-]<name>-yyy must not 
have different ';
+            ;;; kukit.E += '[namespace and] name then the kss selector at the 
top of the rule, "';
+            ;;; kukit.E += key + '", and inside we have "' + 
block.evt_namespace + '-' + block.evt_name + '"';
+            block.emitError(kukit.E);
         }
     }
     // Create the event rule. (one action only)
@@ -161,28 +158,16 @@
     // default-error: <VALUE>
     //
     var splitkey = key.split('-');
-    /*
-    ;;; */
-    if (splitkey.length < 2 || splitkey.length > 4) {
-        this.emitError(
-            'kss param key must be like xxx-yyy or nnn-xxx-yyy or evt-xxx-yyy 
or evt-nnn-xxx-yyy"'
-            + key + '"');
-    }
-    ;;; /*
-    */
+    ;;; if (splitkey.length < 2 || splitkey.length > 4) {
+    ;;;     this.emitError('kss param key must be like xxx-yyy or nnn-xxx-yyy 
or evt-xxx-yyy or evt-nnn-xxx-yyy"' + key + '"');
+    ;;; }
     var name = splitkey[0];
     if (name == 'evt') {
         // evt-<EVTNAME>-<KEY>: <VALUE>
         // evt-<NAMESPACE>-<EVTNAME>-<KEY>: <VALUE>
-        /*
-        ;;; */
-        if (splitkey.length < 3) {
-            this.emitError(
-                'kss param key must be like xxx-yyy or nnn-xxx-yyy or 
evt-xxx-yyy or evt-nnn-xxx-yyy"'
-                + key + '"');
-        }
-        ;;; /*
-        */
+        ;;; if (splitkey.length < 3) {
+        ;;;     this.emitError('kss param key must be like xxx-yyy or 
nnn-xxx-yyy or evt-xxx-yyy or evt-nnn-xxx-yyy"' + key + '"');
+        ;;; }
         var enamespace;
         var ename;
         var ekey;
@@ -201,20 +186,17 @@
             // so that we can check it stays the same within the block.
             this.evt_name = ename;
             this.evt_namespace = enamespace;
-        /*
-        ;;; */
-        } else {
-            if (ename != this.evt_name || enamespace != this.evt_namespace) {
-                // Do not allow deviation from the previous event names.
-                this.emitError('kss param key evt-[<namespace>-]<name>-yyy 
must not have different [namespace and] name inside the same rule,"' 
-                    + key + '", it must be "' + this.evt_namespace + '-' + 
this.evt_name + '"');
-            }
-        }
-        if (value.isMethod != false) {
-            this.emitError('evt-[nnn-]xxx-yyy: parameter producers are not 
allowed as value, key "' 
-                + key + '"');
-        ;;; /*
-        */
+        ;;; } else {
+        ;;;     if (ename != this.evt_name || enamespace != 
this.evt_namespace) {
+        ;;;         // Do not allow deviation from the previous event names.
+        ;;;         kukit.E = 'kss param key evt-[<namespace>-]<name>-yyy must 
not have different ';
+        ;;;         kukit.E += '[namespace and] name inside the same rule,"' + 
key + '", it must be "';
+        ;;;         kukit.E += this.evt_namespace + '-' + this.evt_name + '"';
+        ;;;         this.emitError(kukit.E);
+        ;;;     }
+        ;;; }
+        ;;; if (value.isMethod != false) {
+        ;;;     this.emitError('evt-[nnn-]xxx-yyy: parameter producers are not 
allowed as value, key "' + key + '"');
         }
         // set it
         this.evt_parms[ekey] = value.txt;
@@ -224,39 +206,22 @@
         // action-client: <NAMESPACE>-<ACTIONNAME>
         // action-cancel: <ACTIONNAME>
         // action-cancel: <NAMESPACE>-<ACTIONNAME>
-        /*
-        ;;; */
-        if (splitkey.length != 2) {
-            this.emitError(
-                'action-xxx must not have more "-" in it, key "' +
-                key + '"');
-        }
-        if (value.isMethod != false) {
-            this.emitError('action-xxx: parameter producers are not allowed as 
value, key "' 
-                + key + '"');
-        }
-        ;;; /*
-        */
+        ;;; if (splitkey.length != 2) {
+        ;;;     this.emitError('action-xxx must not have more "-" in it, key 
"' + key + '"');
+        ;;; }
+        ;;; if (value.isMethod != false) {
+        ;;;     this.emitError('action-xxx: parameter producers are not 
allowed as value, key "'  + key + '"');
+        ;;; }
         var atab = {'server': 'S', 'client': 'C', 'cancel': 'X'};
         var actionType = atab[splitkey[1]];
-        /*
-        ;;; */
-        if (! actionType) {
-            this.emitError('action-xxx: key must be action-server or 
action-client or action-cancel, key "' 
-                + key + '"');
-        }    
-        ;;; /*
-        */
-        // force value to be <ACTIONNAME> or <NAMESPACE>-<ACTIONNAME>
-        var splitvalue = value.txt.split('-');
-        /*
-        ;;; */
-        if (splitvalue.length > 2) {
-            this.emitError('action-xxx: value must be <ACTIONNAME> or 
<NAMESPACE>-<ACTIONNAME>, key "' 
-                + key + '"');
-        }
-        ;;; /*
-        */
+        ;;; if (! actionType) {
+        ;;;     this.emitError('action-xxx: key must be action-server or 
action-client or action-cancel, key "' + key + '"');
+        ;;; }    
+        ;;; // force value to be <ACTIONNAME> or <NAMESPACE>-<ACTIONNAME>
+        ;;; var splitvalue = value.txt.split('-');
+        ;;; if (splitvalue.length > 2) {
+        ;;;     this.emitError('action-xxx: value must be <ACTIONNAME> or 
<NAMESPACE>-<ACTIONNAME>, key "' + key + '"');
+        ;;; }
         // set it
         var action = this.actions.getOrCreateAction(value.txt);
         if (actionType != 'X' || action.type == null) {
@@ -292,14 +257,9 @@
             case 'error': {
                     // <ACTIONNAME>-error: <VALUE>
                     // default-error: <VALUE>
-                    /*
-                    ;;; */
-                    if (value.isMethod != false) {
-                        this.emitError('xxx-error: parameter producers are not 
allowed as value, key "' 
-                            + key + '"');
-                    }
-                    ;;; /*
-                    */
+                    ;;; if (value.isMethod != false) {
+                    ;;;     this.emitError('xxx-error: parameter producers are 
not allowed as value, key "' + key + '"');
+                    ;;; }
                     action.setError(value.txt);
                     // also create the action for the error itself.
                     var err_action = this.actions.getOrCreateAction(value.txt);
@@ -327,8 +287,8 @@
                         // Check also sets the parameter provider on the value.
                         value.check(registry);
                     } catch(e) {
-                        ;;; throw new kukit.err.tk.ParsingError('Error in 
value: ' + e,  this.src.makeMarker(this.startpos));
-                        throw "E";
+                        ;;; kukit.E = new kukit.err.tk.ParsingError('Error in 
value: ' + e,  this.src.makeMarker(this.startpos));
+                        throw kukit.E;
                     }
                 } break;
         }

Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/kukit.js
==============================================================================
--- kukit/kukit.js/branch/ree-stripout-comments/kukit/kukit.js  (original)
+++ kukit/kukit.js/branch/ree-stripout-comments/kukit/kukit.js  Mon Jun 11 
16:08:40 2007
@@ -159,10 +159,8 @@
         }
     }
     if (found) {
-        ;;; this.bindScheduler.addPre(deferred_setup_events, 'setting up 
events for ' + targetmsg);
-        ;;; /*
-            this.bindScheduler.addPre(deferred_setup_events, '');
-        ;;; */
+        ;;; kukit.E = 'setting up events for ' + targetmsg;
+        this.bindScheduler.addPre(deferred_setup_events, kukit.E);
     }
 };
 

Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/oper.js
==============================================================================
--- kukit/kukit.js/branch/ree-stripout-comments/kukit/oper.js   (original)
+++ kukit/kukit.js/branch/ree-stripout-comments/kukit/oper.js   Mon Jun 11 
16:08:40 2007
@@ -77,14 +77,9 @@
         return;
     }
     for (var key in dict) {
-        /*
-        ;;; */
-         if (restricted && (key == 'node' || key == 'parms' || key == 
'eventrule' 
-                 || key == 'binderinstance' || key == 'orignode')) {
-            throw 'Illegal update on oper object, protected attribute "' + key 
+ '"';
-        }
-        ;;; /*
-        */
+        ;;; if (restricted && (key == 'node' || key == 'parms' || key == 
'eventrule' || key == 'binderinstance' || key == 'orignode')) {
+        ;;;    throw 'Illegal update on oper object, protected attribute "' + 
key + '"';
+        ;;; }
         var value = dict[key];
         if (typeof(value) != 'function') {
             this[key] = value;
@@ -119,8 +114,9 @@
                 nodes = this.aparms[key];
             } break;
             default: {
-               ;;; throw 'No kss parameter "' + key + '" allowed in 
action-client. (Normal parameters cannot start with kss.)';
-               throw 'E';
+               ;;; kukit.E = 'No kss parameter "' + key + '" allowed in 
action-client.';
+               ;;; kukit.E += ' (Normal parameters cannot start with kss.)';
+               throw kukit.E;
             } break;
         }
     }
@@ -174,24 +170,15 @@
 };
 
 kukit.op.Oper.prototype.executeServerAction = function(name) {
-    /*
-    ;;; */
-    for (key in this.aparms) {
-        switch (key) {
-            case 'kssUrl': {
-                // Value will be evaluated.
-            } break;
-            case 'kssSubmitForm': {
-                // Value will be evaluated.
-            } break;
-            default: {
-                throw 'No kss parameter "' + key + '" allowed in 
action-server. (Normal parameters cannot start with kss.)';
-            } break;
-        }
-    }
-    ;;; /*
-    */
-
+    ;;; for (key in this.aparms) {
+    ;;;     if (key == 'kssUrl') {
+    ;;;         // Value will be evaluated.
+    ;;;     } else if (key == 'kssSubmitForm') {
+    ;;;         // Value will be evaluated.
+    ;;;     } else {
+    ;;;         throw 'No kss parameter "' + key + '" allowed in 
action-server. (Normal parameters cannot start with kss.)';
+    ;;;     }
+    ;;; }
     // oper will be accessible to some commands that execute in return
     var sa = new kukit.sa.ServerAction(name, this);
 };
@@ -299,25 +286,19 @@
 
 kukit.op.Oper.prototype.evalBool = function(key, errname) {
     var value = this.parms[key];
-    ;;; this.parms[key] = kukit.ut.evalBool(value, 'for key "' + key + '" in ' 
+ errname);
-    ;;; /*
-        this.parms[key] = kukit.ut.evalBool(value, '');
-    ;;; */
+    ;;; kukit.E = 'for key "' + key + '" in ' + errname;
+    this.parms[key] = kukit.ut.evalBool(value, kukit.E);
 };
 
 kukit.op.Oper.prototype.evalInt = function(key, errname) {
     var value = this.parms[key];
-    ;;; this.parms[key] = kukit.ut.evalInt(value, 'for key "' + key + '" in ' 
+ errname || this.componentname);
-    ;;; /*
-        this.parms[key] = kukit.ut.evalInt(value, '');
-    ;;; */
+    ;;; kukit.E = 'for key "' + key + '" in ' + errname || this.componentname;
+    this.parms[key] = kukit.ut.evalInt(value, kukit.E);
 };
 
 kukit.op.Oper.prototype.evalList = function(key, errname) {
     var value = this.parms[key];
-    ;;; this.parms[key] = kukit.ut.evalList(value, 'for key "' + key + '" in ' 
+ errname || this.componentname);
-    ;;; /*
-        this.parms[key] = kukit.ut.evalList(value, '');
-    ;;; */
+    ;;; kukit.E = 'for key "' + key + '" in ' + errname || this.componentname;
+    this.parms[key] = kukit.ut.evalList(value, kukit.E);
 };
 

Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/plugin.js
==============================================================================
--- kukit/kukit.js/branch/ree-stripout-comments/kukit/plugin.js (original)
+++ kukit/kukit.js/branch/ree-stripout-comments/kukit/plugin.js Mon Jun 11 
16:08:40 2007
@@ -339,31 +339,37 @@
             loadoper = null;
             // with the legacy loads we suppose autodetect=false
             iloadoper.parms.autodetect = false;
-            ;;; kukit.logWarning('Deprecated the use of "load" event for 
iframes. It will behave differently in the future. Use the "iload" event (maybe 
with evt-iload-autodetect: false) instead!');
+            ;;; kukit.E = 'Deprecated the use of "load" event for iframes. It 
will behave differently in the future. ';
+            ;;; kukit.E += 'Use the "iload" event (maybe with 
evt-iload-autodetect: false) instead!';
+            ;;; kukit.logWarning(kukit.E);
         } 
     } else {
         // Not an iframe. So iload is not usable.
         if (iloadoper) {
-            ;;; throw 'iload event can only be bound on an iframe node.';
-            throw 'E';
+            ;;; kukit.E = 'iload event can only be bound on an iframe node.';
+            throw kukit.E;
         }
     }
     // Now, bind the events.
     if (loadoper) {
-        ;;; kukit.logDebug('EventRule #' + loadoper.eventrule.getNr() + ' 
mergeid ' + loadoper.eventrule.kss_selector.mergeid + ' event selected normal 
postponed execution.');
+        ;;; kukit.E = 'EventRule #' + loadoper.eventrule.getNr() + ' mergeid ';
+        ;;; kukit.E += loadoper.eventrule.kss_selector.mergeid;
+        ;;; kukit.E += ' event selected normal postponed execution.';
+        ;;; kukit.logDebug(kukit.E);
         // for any other node than iframe, or even for iframe in phase1, we 
need to execute immediately.
         var func_to_bind = loadoper.makeExecuteActionsHook();
-        ;;; kukit.engine.bindScheduler.addPost(func_to_bind, 'Execute load 
event for node ' + loadoper.node.tagName.toLowerCase());
-        ;;; /*
-            kukit.engine.bindScheduler.addPost(func_to_bind, '');
-        ;;; */
+        ;;; kukit.E = 'Execute load event for node ' + 
loadoper.node.tagName.toLowerCase();
+        kukit.engine.bindScheduler.addPost(func_to_bind, kukit.E);
     }
     if (iloadoper) {
         var phase = iloadoper.node._kukitmark;
         // For phase 2 we need to execute posponed, for phase1 immediately.
         // XXX it would be better not need this and do always postponed.
         if (phase == 2 || (phase == 1 && kukit.engine.initializedOnDOMLoad)) {
-            ;;; kukit.logDebug('EventRule #' + iloadoper.eventrule.getNr() + ' 
mergeid ' + iloadoper.eventrule.kss_selector.mergeid + ' event selected delayed 
execution (when iframe loaded)');
+            ;;; kukit.E = 'EventRule #' + iloadoper.eventrule.getNr() + ' 
mergeid ';
+            ;;; kukit.E += iloadoper.eventrule.kss_selector.mergeid;
+            ;;; kukit.E += ' event selected delayed execution (when iframe 
loaded)';
+            ;;; kukit.logDebug(kukit.E);
             // We want the event execute once the iframe is loaded.
             // In a somewhat tricky way, we start the scheduler only from the 
normal delayed execution. This will enable that in
             // case we had a load event on the same node, it could modify the 
name and id parameters and we only start
@@ -372,24 +378,21 @@
             var g = function() {
                 var f = function() {
                     var func_to_bind = iloadoper.makeExecuteActionsHook();
-                    ;;; kukit.engine.bindScheduler.addPost(func_to_bind, 
'Execute iload event for iframe ' + iloadoper.node.name);
-                    ;;; /*
-                        kukit.engine.bindScheduler.addPost(func_to_bind, '');
-                    ;;; */
+                    ;;; kukit.E = 'Execute iload event for iframe ' + 
iloadoper.node.name;
+                    kukit.engine.bindScheduler.addPost(func_to_bind, kukit.E);
                 };
                 new 
kukit.dom.EmbeddedContentLoadedScheduler(iloadoper.node.id, f, 
iloadoper.parms.autodetect);
             };
-            ;;; kukit.engine.bindScheduler.addPost(g, 'Schedule iload event 
for iframe ' + iloadoper.node.name);
-            ;;; /*
-                kukit.engine.bindScheduler.addPost(g, '');
-            ;;; */
+            ;;; kukit.E = 'Schedule iload event for iframe ' + 
iloadoper.node.name;
+            kukit.engine.bindScheduler.addPost(g, kukit.E);
         } else {
-            ;;; kukit.logDebug('EventRule #' + iloadoper.eventrule.getNr() + ' 
mergeid ' + iloadoper.eventrule.kss_selector.mergeid + ' event selected normal 
postponed execution.');
+            ;;; kukit.E = 'EventRule #' + iloadoper.eventrule.getNr() + ' 
mergeid ';
+            ;;; kukit.E += iloadoper.eventrule.kss_selector.mergeid;
+            ;;; kukit.E += ' event selected normal postponed execution.';
+            ;;; kukit.logDebug(kukit.E);
             var func_to_bind = iloadoper.makeExecuteActionsHook();
-            ;;; kukit.engine.bindScheduler.addPost(func_to_bind, 'Execute 
iload event for iframe ' + iloadoper.node.name);
-            ;;; /*
-                kukit.engine.bindScheduler.addPost(func_to_bind, '');
-            ;;; */
+            ;;; kukit.E = 'Execute iload event for iframe ' + 
iloadoper.node.name;
+            kukit.engine.bindScheduler.addPost(func_to_bind, kukit.E);
         }
     }
 };
@@ -569,8 +572,8 @@
     ;;; oper.componentname = 'setAttribute action';
     oper.completeParms(['name', 'value'], {});
     if (oper.parms.name.toLowerCase() == 'style') {
-        ;;; throw 'Style attribute is not allowed with setAttribute';
-        throw 'E';
+        ;;; kukit.E = 'Style attribute is not allowed with setAttribute';
+        throw kukit.E;
     }
     kukit.dom.setAttribute(oper.node, oper.parms.name, oper.parms.value);
 });

Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/providerreg.js
==============================================================================
--- kukit/kukit.js/branch/ree-stripout-comments/kukit/providerreg.js    
(original)
+++ kukit/kukit.js/branch/ree-stripout-comments/kukit/providerreg.js    Mon Jun 
11 16:08:40 2007
@@ -54,8 +54,8 @@
             // default provider for the strings
             return kukit.pr.IdentityPP;
          } else {
-            ;;; throw 'Error : undefined parameter provider "' + name + '"';
-            throw 'E';
+            ;;; kukit.E = 'Error : undefined parameter provider "' + name + 
'"';
+            throw kukit.E;
         }
     }
     return func;
@@ -158,10 +158,8 @@
         var argname =  args[0];
         var recurseParents = false;
         if (args.length == 2) {
-            ;;; kukit.ut.evalBool(args[1], '2nd attribute of 
currentFormVarForKssAttr must be a boolean');
-            ;;; /*
-                kukit.ut.evalBool(args[1], '');
-            ;;; */
+            ;;; kukit.E = '2nd attribute of currentFormVarForKssAttr must be a 
boolean';
+            kukit.ut.evalBool(args[1], kukit.E);
             recurseParents = args[1];
         }
         var formvarname = kukit.dom.getRecursiveAttribute(node, argname, 
recurseParents, kukit.dom.getKssAttribute);
@@ -231,10 +229,8 @@
         var recurseParents = false;
         if (args.length == 2) {
             recurseParents = args[1];
-            ;;; kukit.ut.evalBool(recurseParents, '2nd attribute of nodeAttr 
must be a boolean');
-            ;;; /*
-                kukit.ut.evalBool(recurseParents, '');
-            ;;; */
+            ;;; kukit.E = '2nd attribute of nodeAttr must be a boolean';
+            kukit.ut.evalBool(recurseParents, kukit.E);
         }
         return kukit.dom.getRecursiveAttribute(node, argname, recurseParents, 
kukit.dom.getAttribute);
     }
@@ -260,10 +256,8 @@
         var recurseParents = false;
         if (args.length == 2) {
             recurseParents = args[1];
-            ;;; kukit.ut.evalBool(recurseParents, '2nd attribute of kssAttr 
must be a boolean');
-            ;;; /*
-                kukit.ut.evalBool(recurseParents, '2nd attribute of kssAttr 
must be a boolean');
-            ;;; */
+            ;;; kukit.E = '2nd attribute of kssAttr must be a boolean';
+            kukit.ut.evalBool(recurseParents, kukit.E);
         }
         return kukit.dom.getRecursiveAttribute(node, argname, recurseParents, 
kukit.dom.getKssAttribute);
     }
@@ -307,8 +301,8 @@
         var value = kukit.engine.statevars[key];
         if (typeof(value) == 'undefined') {
             // notfound arguments will get null
-            ;;; throw 'Nonexistent statevar "'+ key +'"';
-            throw 'E';
+            ;;; kukit.E = 'Nonexistent statevar "'+ key +'"';
+            throw kukit.E;
         }
         return value;
     }
@@ -331,8 +325,8 @@
         var value = defaultparms[key];
         if (typeof(value) == 'undefined') {
             // notfound arguments will get null
-            ;;; throw 'Nonexistent default parm "'+ key +'"';
-            throw 'E';
+            ;;; kukit.E = 'Nonexistent default parm "'+ key +'"';
+            throw kukit.E;
         }
         return value;
     }

Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/resourcedata.js
==============================================================================
--- kukit/kukit.js/branch/ree-stripout-comments/kukit/resourcedata.js   
(original)
+++ kukit/kukit.js/branch/ree-stripout-comments/kukit/resourcedata.js   Mon Jun 
11 16:08:40 2007
@@ -323,8 +323,8 @@
                 action = new kukit.rd.Action();
                 this.content[key] = action;
              } else {
-                ;;; throw new kukit.err.rd.RuleMergeError('Cannot 
action-delete unexisting action, "' + key + '"');
-                throw 'E';
+                ;;; kukit.E = new kukit.err.rd.RuleMergeError('Cannot 
action-delete unexisting action, "' + key + '"');
+                throw kukit.E;
             }
         }
         if (action2.type != 'X') {

Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/selectorreg.js
==============================================================================
--- kukit/kukit.js/branch/ree-stripout-comments/kukit/selectorreg.js    
(original)
+++ kukit/kukit.js/branch/ree-stripout-comments/kukit/selectorreg.js    Mon Jun 
11 16:08:40 2007
@@ -73,8 +73,8 @@
         var value = defaultparms[args[0]];
         if (typeof(value) == 'undefined') {
             // notfound arguments will get null
-            ;;; throw 'Nonexistent default parm "'+ key +'"';
-            throw 'E';
+            ;;; kukit.E = 'Nonexistent default parm "'+ key +'"';
+            throw kukit.E;
         }
         nodes = [value];
         return nodes;

Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/serveraction.js
==============================================================================
--- kukit/kukit.js/branch/ree-stripout-comments/kukit/serveraction.js   
(original)
+++ kukit/kukit.js/branch/ree-stripout-comments/kukit/serveraction.js   Mon Jun 
11 16:08:40 2007
@@ -157,8 +157,8 @@
             try {
                 dom = (new DOMParser()).parseFromString(payload, "text/xml");
             } catch(e) {
-                ;;; throw new kukit.err.ResponseParsingError('Error parsing 
X-KSSCOMMANDS header.');
-                throw 'E';
+                ;;; kukit.E = new kukit.err.ResponseParsingError('Error 
parsing X-KSSCOMMANDS header.');
+                throw kukit.E;
             }
             commandstags = kukit.dom.getNsTags(dom, 'commands');
             if (commandstags.length != 1) {
@@ -172,17 +172,17 @@
             dom = domDoc.responseXML;
             ;;; var errtxt = 'Unknown server error (invalid KSS response, no 
error info received)';
             ;;; if (dom && dom.parseError && (dom.parseError != 0)) {
-            ;;;    throw new kukit.err.ResponseParsingError(errtxt + ': ' + 
Sarissa.getParseErrorText(dom));
+            ;;;     kukit.E = new kukit.err.ResponseParsingError(errtxt + ': ' 
+ Sarissa.getParseErrorText(dom));
             ;;; } else {
-            ;;;     throw new kukit.err.ResponseParsingError(errtxt);
+            ;;;     kukit.E = new kukit.err.ResponseParsingError(errtxt);
             ;;; }
-            throw 'E';
+            throw kukit.E;
         }
     }
     if (dom == null) {
         // this should not happen
-        ;;; throw new kukit.err.ResponseParsingError('Neither xml nor html 
payload.');
-        throw 'E';
+        ;;; kukit.E = new kukit.err.ResponseParsingError('Neither xml nor html 
payload.');
+        throw kukit.E;
     }
     // find the commands (atm we don't limit ourselves inside the commandstag)
     var commands = kukit.dom.getNsTags(dom, 'command');
@@ -211,17 +211,17 @@
     ;;;     reason = ', server_reason="' + errorcommand.parms.message + '" ';
     ;;; }
     if (error_action) {
-        /*
-        ;;; */
-        kukit.logWarning('Request failed at url ' + this.oper.queueItem.url +
-        ', rid=' + this.oper.queueItem.rid + reason + ', will be handled by 
action "' + error_action.name + '"');
+        ;;; kukit.E = 'Request failed at url ' + this.oper.queueItem.url;
+        ;;; kukit.E += ', rid=' + this.oper.queueItem.rid + reason;
+        ;;; kukit.E += ', will be handled by action "' + error_action.name + 
'"';
+        ;;; kukit.logWarning(kukit.E);
         // Individual error handler was defined. Execute it!
-        ;;; /*
-        */
         error_action.execute(this.oper);
     } else {
         // Unhandled: just log it...
-        ;;; kukit.logError('Request failed at url ' + this.oper.queueItem.url 
+ ', rid=' + this.oper.queueItem.rid + reason);
+        ;;; kukit.E = 'Request failed at url ' + this.oper.queueItem.url;
+        ;;; kukit.E += ', rid=' + this.oper.queueItem.rid + reason;
+        ;;; kukit.logError(kukit.E);
     }
 };
 

Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/tokenizer.js
==============================================================================
--- kukit/kukit.js/branch/ree-stripout-comments/kukit/tokenizer.js      
(original)
+++ kukit/kukit.js/branch/ree-stripout-comments/kukit/tokenizer.js      Mon Jun 
11 16:08:40 2007
@@ -31,8 +31,8 @@
 
 kukit.tk._TokenBase.prototype.emitError = function(txt) {
     // Use the start position of the token for the error report.
-    ;;; throw new kukit.err.tk.ParsingError(txt, 
this.src.makeMarker(this.startpos));
-    throw 'E';
+    ;;; kukit.E = new kukit.err.tk.ParsingError(txt, 
this.src.makeMarker(this.startpos));
+    throw kukit.E;
 };
 
 kukit.tk._TokenBase.prototype.setSrcStatus = function(eofOk) {

Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/utils.js
==============================================================================
--- kukit/kukit.js/branch/ree-stripout-comments/kukit/utils.js  (original)
+++ kukit/kukit.js/branch/ree-stripout-comments/kukit/utils.js  Mon Jun 11 
16:08:40 2007
@@ -1,9 +1,6 @@
 /*
-* Copyright (c) 2005-2006
-* Authors:
-*   Godefroid Chapelle <[EMAIL PROTECTED]>
-*   Florian Schulze <[EMAIL PROTECTED]>
-*   Balazs Ree <[EMAIL PROTECTED]>
+* Copyright (c) 2005-2007
+* Authors: KSS Project Contributors (see docs/CREDITS.txt)
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as published
@@ -31,15 +28,37 @@
 ;;;  *  ----------------------------------------------------------------
 ;;;  */
 
+/*
+ * kukit.E is a proxy variable used globally for error and info messages.
+ * This assure the following code can be used:
+ *    
+ *     ;;; kukit.E = 'This is the error message';
+ *     throw kukit.E;
+ *
+ * or:
+ *
+ *     ;;; kukit.E = 'The event' + event + ' caused problems';
+ *     method_with_info(x, kukit.E);
+ *
+ * or even:
+ *
+ *     ;;; kukit.E = 'The event' + event + ' caused problems ';
+ *     ;;; kukit.E += 'and this is a very long line ';
+ *     ;;; kukit.E += 'so we split it to parts for better readibility';
+ *     ;;; kukit.logWarning(kukit.E);
+ *
+ */
+kukit.E = 'Unknown message (kss optimized for production mode)';
+
 // Browser identification. We need these switches only at the moment.
 try {
     kukit.HAVE_SAFARI = navigator.vendor && navigator.vendor.indexOf('Apple') 
!= -1;
     kukit.HAVE_IE =  eval("_SARISSA_IS_IE");
 } catch (e) {}
 
-// Activation of extra logging panel: if necessary
-// this allows to start the logging panel from the browser with
-//    javascript:kukit.showlog();
+;;; // Activation of extra logging panel: if necessary
+;;; // this allows to start the logging panel from the browser with
+;;; //    javascript:kukit.showlog();
 ;;; kukit.showlog = function() {
 ;;;     kukit.logWarning('Logging is on the console: request to show logging 
pane ignored');
 ;;; };
@@ -53,62 +72,40 @@
 //  }
 kukit.hasFirebug = false;
 
-/* check whether the logging stuff of Firebug is available */
-/*
-;;; */
-if (typeof kukit.log == 'undefined' &&
-    typeof console != 'undefined' &&
-    typeof console.log != 'undefined' &&
-    typeof console.debug != 'undefined' &&
-    typeof console.error != 'undefined' &&
-    typeof console.warn != 'undefined') {
-        kukit.log = console.log;
-        kukit.logDebug = console.debug;
-        kukit.logFatal = console.error;
-        kukit.logError = console.error;
-        kukit.logWarning = console.warn;
-        kukit.hasFirebug = true;
-}
-;;; /*
- */
+;;; // check whether the logging stuff of Firebug is available
+;;; if (typeof kukit.log == 'undefined' && typeof console != 'undefined' && 
typeof console.log != 'undefined' && typeof console.debug != 'undefined' && 
typeof console.error != 'undefined' && typeof console.warn != 'undefined') {
+;;;         kukit.log = console.log;
+;;;         kukit.logDebug = console.debug;
+;;;         kukit.logFatal = console.error;
+;;;         kukit.logError = console.error;
+;;;         kukit.logWarning = console.warn;
+;;;         kukit.hasFirebug = true;
+;;; }
 
-/* check whether the logging stuff of MochiKit is available */
-/*
-;;; */
-if (typeof kukit.log == 'undefined' &&
-    typeof MochiKit != 'undefined' &&
-    typeof MochiKit.Logging != 'undefined' &&
-    typeof MochiKit.Logging.log != 'undefined') {
-        kukit.log = MochiKit.Logging.log;
-        kukit.logError = MochiKit.Logging.logError;
-        kukit.logDebug = MochiKit.Logging.logDebug;
-        kukit.logFatal = MochiKit.Logging.logFatal;
-        kukit.logWarning = MochiKit.Logging.logWarning;
-        // make convenience url
-        //    javascript:kukit.showlog();
-        // instead of the need to say
-        //    javascript:void(createLoggingPane(true));
-        kukit.showlog = function() {
-            createLoggingPane(true);
-        };
-}
-;;; /*
- */
+;;; // check whether the logging stuff of MochiKit is available
+;;; if (typeof kukit.log == 'undefined' && typeof MochiKit != 'undefined' && 
typeof MochiKit.Logging != 'undefined' && typeof MochiKit.Logging.log != 
'undefined') {
+;;;         kukit.log = MochiKit.Logging.log;
+;;;         kukit.logError = MochiKit.Logging.logError;
+;;;         kukit.logDebug = MochiKit.Logging.logDebug;
+;;;         kukit.logFatal = MochiKit.Logging.logFatal;
+;;;         kukit.logWarning = MochiKit.Logging.logWarning;
+;;;         // make convenience url
+;;;         //    javascript:kukit.showlog();
+;;;         // instead of the need to say
+;;;         //    javascript:void(createLoggingPane(true));
+;;;         kukit.showlog = function() {
+;;;             createLoggingPane(true);
+;;;         };
+;;; }
 
-/* check whether the logging stuff of Safari is available */
-/*
-;;; */
-if (typeof kukit.log == 'undefined' &&
-    typeof console != 'undefined' &&
-    typeof console.log != 'undefined') {
-        kukit.log = function(str) { console.log('INFO: '+str); };
-        kukit.logError = function(str) { console.log('ERROR: '+str); };
-        kukit.logDebug = function(str) { console.log('DEBUG: '+str); };
-        kukit.logFatal = function(str) { console.log('FATAL: '+str); };
-        kukit.logWarning = function(str) { console.log('WARNING: '+str); };
-}
-;;; /*
- */
+;;; // check whether the logging stuff of Safari is available
+;;; if (typeof kukit.log == 'undefined' && typeof console != 'undefined' && 
typeof console.log != 'undefined') {
+;;;         kukit.log = function(str) { console.log('INFO: '+str); };
+;;;         kukit.logError = function(str) { console.log('ERROR: '+str); };
+;;;         kukit.logDebug = function(str) { console.log('DEBUG: '+str); };
+;;;         kukit.logFatal = function(str) { console.log('FATAL: '+str); };
+;;;         kukit.logWarning = function(str) { console.log('WARNING: '+str); };
+;;; }
 
 /* no logging solution available */
 ;;; if (typeof kukit.log == 'undefined') {
@@ -277,8 +274,8 @@
 
 kukit.ut.TimerCounter.prototype.start = function() {
     if (this.timer) {
-        ;;; throw 'Timer already started.';
-        throw 'E';
+        ;;; kukit.E = 'Timer already started.';
+        throw kukit.E;
     }
     var self = this;
     var func = function() {
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins

Reply via email to