Changeset 6392

Show
Ignore:
Timestamp:
11/01/06 08:45:48 (21 months ago)
Author:
liucougar
Message:

more descriptive error message when event connection goes wrong
fix dojo.raise to handle exception correctly

Location:
trunk/src
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/bootstrap1.js

    r6258 r6392  
    1414// TODOC: HOW TO DOC THE BELOW? 
    1515// @global: djConfig 
    16 // summary:   
     16// summary: 
    1717//              Application code can set the global 'djConfig' prior to loading 
    18 //              the library to override certain global settings for how dojo works.   
     18//              the library to override certain global settings for how dojo works. 
    1919// description:  The variables that can be set are as follows: 
    2020//                      - isDebug: false 
     
    3333// TODOC: IS THIS A COMPLETE LIST? 
    3434// note: 
    35 //              'djConfig' does not exist under 'dojo.*' so that it can be set before the  
    36 //              'dojo' variable exists.   
     35//              'djConfig' does not exist under 'dojo.*' so that it can be set before the 
     36//              'dojo' variable exists. 
    3737// note: 
    38 //              Setting any of these variables *after* the library has loaded does nothing at all.  
     38//              Setting any of these variables *after* the library has loaded does nothing at all. 
    3939// TODOC: is this still true?  Release notes for 0.3 indicated they could be set after load. 
    4040// 
     
    4343//TODOC:  HOW TO DOC THIS? 
    4444// @global: dj_global 
    45 // summary:  
     45// summary: 
    4646//              an alias for the top-level global object in the host environment 
    4747//              (e.g., the window object in a browser). 
    48 // description:   
     48// description: 
    4949//              Refer to 'dj_global' rather than referring to window to ensure your 
    5050//              code runs correctly in contexts other than web browsers (eg: Rhino on a server). 
     
    5353//TODOC:  HOW TO DOC THIS? 
    5454// @global: dj_currentContext 
    55 // summary:  
     55// summary: 
    5656//              Private global context object. Where 'dj_global' always refers to the boot-time 
    5757//    global context, 'dj_currentContext' can be modified for temporary context shifting. 
    5858//    dojo.global() returns dj_currentContext. 
    59 // description:   
     59// description: 
    6060//              Refer to dojo.global() rather than referring to dj_global to ensure your 
    6161//              code runs correctly in managed contexts. 
     
    7575 
    7676// make sure djConfig is defined 
    77 if(dj_undef("djConfig", this)){  
    78         var djConfig = {};  
     77if(dj_undef("djConfig", this)){ 
     78        var djConfig = {}; 
    7979} 
    8080 
    8181//TODOC:  HOW TO DOC THIS? 
    8282// dojo is the root variable of (almost all) our public symbols -- make sure it is defined. 
    83 if(dj_undef("dojo", this)){  
    84         var dojo = {};  
     83if(dj_undef("dojo", this)){ 
     84        var dojo = {}; 
    8585} 
    8686 
     
    8989        //              return the current global context object 
    9090        //              (e.g., the window object in a browser). 
    91         // description:  
     91        // description: 
    9292        //              Refer to 'dojo.global()' rather than referring to window to ensure your 
    9393        //              code runs correctly in contexts other than web browsers (eg: Rhino on a server). 
     
    112112dojo.evalProp = function(/*String*/ name, /*Object*/ object, /*Boolean?*/ create){ 
    113113        // summary: Returns 'object[name]'.  If not defined and 'create' is true, will return a new Object. 
    114         // description:  
     114        // description: 
    115115        //              Returns null if 'object[name]' is not defined and 'create' is not true. 
    116         //              Note: 'defined' and 'exists' are not the same concept.   
     116        //              Note: 'defined' and 'exists' are not the same concept. 
    117117        if((!object)||(!name)) return undefined; // undefined 
    118118        if(!dj_undef(name, object)) return object[name]; // mixed 
     
    122122dojo.parseObjPath = function(/*String*/ path, /*Object?*/ context, /*Boolean?*/ create){ 
    123123        // summary: Parse string path to an object, and return corresponding object reference and property name. 
    124         // description:  
    125         //              Returns an object with two properties, 'obj' and 'prop'.   
     124        // description: 
     125        //              Returns an object with two properties, 'obj' and 'prop'. 
    126126        //              'obj[prop]' is the reference indicated by 'path'. 
    127127        // path: Path to an object, in the form "A.B.C". 
     
    141141        // path: Path to an object, in the form "A.B.C". 
    142142        // create: If true, Objects will be created at any point along the 'path' that is undefined. 
    143         if(typeof path != "string"){  
    144                 return dojo.global();  
     143        if(typeof path != "string"){ 
     144                return dojo.global(); 
    145145        } 
    146146        // fast path for no periods 
     
    178178        if(exception){ 
    179179                message = message + ": "+dojo.errorToString(exception); 
     180        }else{ 
     181                message = dojo.errorToString(message); 
    180182        } 
    181183 
     
    192194dojo.profile = { start: function(){}, end: function(){}, stop: function(){}, dump: function(){} }; 
    193195 
    194 function dj_eval(/*String*/ scriptFragment){  
     196function dj_eval(/*String*/ scriptFragment){ 
    195197        // summary: Perform an evaluation in the global scope.  Use this rather than calling 'eval()' directly. 
    196198        // description: Placed in a separate function to minimize size of trapped evaluation context. 
     
    265267dojo.hostenv = (function(){ 
    266268        // TODOC:  HOW TO DOC THIS? 
    267         // summary: Provides encapsulation of behavior that changes across different 'host environments'  
     269        // summary: Provides encapsulation of behavior that changes across different 'host environments' 
    268270        //                      (different browsers, server via Rhino, etc). 
    269271        // description: None of these methods should ever be called directly by library users. 
    270272        //                              Use public methods such as 'loadModule' instead. 
    271          
     273 
    272274        // default configuration options 
    273275        var config = { 
     
    299301 
    300302 
    301                 getName: function(){  
     303                getName: function(){ 
    302304                        // sumary: Return the name of the host environment. 
    303305                        return this.name_;      // String 
     
    305307 
    306308 
    307                 getVersion: function(){  
     309                getVersion: function(){ 
    308310                        // summary: Return the version of the hostenv. 
    309311                        return this.version_; // String 
     
    312314                getText: function(/*String*/ uri){ 
    313315                        // summary:     Read the plain/text contents at the specified 'uri'. 
    314                         // description:  
    315                         //                      If 'getText()' is not implemented, then it is necessary to override  
     316                        // description: 
     317                        //                      If 'getText()' is not implemented, then it is necessary to override 
    316318                        //                      'loadUri()' with an implementation that doesn't rely on it. 
    317319 
     
    327329        //              MAYBE:  Return the base uri to scripts in the dojo library.      ??? 
    328330        // return: Empty string or a path ending in '/'. 
    329         if(djConfig.baseScriptUri.length){  
     331        if(djConfig.baseScriptUri.length){ 
    330332                return djConfig.baseScriptUri; 
    331333        } 
  • trunk/src/debug.js

    r6280 r6392  
    33        //              Produce a line of debug output. Does nothing unless 
    44        //              djConfig.isDebug is true. Accepts any nubmer of args, joined with 
    5         //              '' to produce a single line of debugging output.  Caller should not 
     5        //              ' ' to produce a single line of debugging output.  Caller should not 
    66        //              supply a trailing "\n". 
    77        if (!djConfig.isDebug) { return; } 
  • trunk/src/event/common.js

    r6187 r6392  
    713713                                result = this.object[this.methodname].apply(this.object, args); 
    714714                        } 
    715                 }catch(e){ if(!this.squelch){ dojo.raise(e); } } 
     715                }catch(e){  
     716                        if(!this.squelch){  
     717                                dojo.debug(e,"when calling",this.methodname,"on",this.object,"with arguments",args); 
     718                                dojo.raise(e); 
     719                        }  
     720                } 
    716721 
    717722                if((this["after"])&&(this.after.length>0)){