Changeset 7649

Show
Ignore:
Timestamp:
03/18/07 03:41:53 (22 months ago)
Author:
alex
Message:

implements changes that allow both the Rhino and Spidermonkey hostenv's to run the test harness smoke test successfully. Refs #2500

Location:
dojo/trunk/_base/_loader
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • dojo/trunk/_base/_loader/bootstrap.js

    r7639 r7649  
    1010//                      - baseRelativePath: "" 
    1111//                      - libraryScriptUri: "" 
    12 //                      - iePreventClobber: false 
    13 //                      - ieClobberMinimal: true 
    1412//                      - locale: undefined 
    1513//                      - extraLocale: undefined 
    1614//                      - preventBackButtonFix: true 
    17 //                      - searchIds: [] 
    18 //                      - parseWidgets: true 
    19 // TODOC: HOW TO DOC THESE VARIABLES? 
    20 // TODOC: IS THIS A COMPLETE LIST? 
    2115// note: 
    2216//              'djConfig' does not exist under 'dojo.*' so that it can be set before the 
     
    2721 
    2822 
    29 //TODOC:  HOW TO DOC THIS? 
    30 // @global: dj_global 
    31 // summary: 
    32 //              an alias for the top-level global object in the host environment 
    33 //              (e.g., the window object in a browser). 
    34 // description: 
    35 //              Refer to 'dj_global' rather than referring to window to ensure your 
    36 //              code runs correctly in contexts other than web browsers (eg: Rhino on a server). 
    37 var dj_global = this; 
    38  
    39 //TODOC:  HOW TO DOC THIS? 
    40 // @global: dj_currentContext 
    41 // summary: 
    42 //              Private global context object. Where 'dj_global' always refers to the boot-time 
    43 //    global context, 'dj_currentContext' can be modified for temporary context shifting. 
    44 //    dojo.global() returns dj_currentContext. 
    45 // description: 
    46 //              Refer to dojo.global() rather than referring to dj_global to ensure your 
    47 //              code runs correctly in managed contexts. 
    48 var dj_currentContext = this; 
    49  
    50  
    51 // **************************************************************** 
    52 // global public utils 
    53 // TODOC: DO WE WANT TO NOTE THAT THESE ARE GLOBAL PUBLIC UTILS? 
    54 // **************************************************************** 
    55  
    56 function dj_undef(/*String*/ name, /*Object?*/ object){ 
    57         //summary: Returns true if 'name' is defined on 'object' (or globally if 'object' is null). 
    58         //description: Note that 'defined' and 'exists' are not the same concept. 
    59         return (typeof (object || dj_currentContext)[name] == "undefined");     // Boolean 
    60 } 
    61  
    62 // make sure djConfig is defined 
    63 if(dj_undef("djConfig", this)){ 
    64         var djConfig = {}; 
    65 } 
    66  
    67 //TODOC:  HOW TO DOC THIS? 
    68 // dojo is the root variable of (almost all) our public symbols -- make sure it is defined. 
    69 if(dj_undef("dojo", this)){ 
    70         var dojo = {}; 
    71 } 
    72  
    73 dojo.global = function(){ 
    74         // summary: 
    75         //              return the current global context object 
    76         //              (e.g., the window object in a browser). 
    77         // description: 
    78         //              Refer to 'dojo.global()' rather than referring to window to ensure your 
    79         //              code runs correctly in contexts other than web browsers (eg: Rhino on a server). 
    80         return dj_currentContext; 
    81 } 
     23(function(){ 
     24        // make sure djConfig is defined 
     25        if(typeof this["djConfig"] == "undefined"){ 
     26                this.djConfig = {}; 
     27        } 
     28 
     29        //TODOC:  HOW TO DOC THIS? 
     30        // dojo is the root variable of (almost all) our public symbols -- make sure it is defined. 
     31        if(typeof this["dojo"] == "undefined"){ 
     32                this.dojo = {}; 
     33        } 
     34 
     35        dojo._currentContext = this; 
     36 
     37        dojo.global = function(){ 
     38                // summary: 
     39                //              return the current global context object 
     40                //              (e.g., the window object in a browser). 
     41                // description: 
     42                //              Refer to 'dojo.global()' rather than referring to window to ensure your 
     43                //              code runs correctly in contexts other than web browsers (eg: Rhino on a server). 
     44                return this._currentContext; 
     45        } 
     46 
     47        var _config = { 
     48                isDebug: false, 
     49                allowQueryConfig: false, 
     50                baseScriptUri: "", 
     51                baseRelativePath: "", 
     52                libraryScriptUri: "", 
     53                preventBackButtonFix: true, 
     54                delayMozLoadingFix: false 
     55        }; 
     56 
     57        for(var option in _config){ 
     58                if(typeof djConfig[option] == "undefined"){ 
     59                        djConfig[option] = _config[option]; 
     60                } 
     61        } 
     62 
     63        var _platforms = ["Browser", "Rhino", "Spidermonkey", "Mobile"]; 
     64        var t; 
     65        while(t=_platforms.shift()){ 
     66                dojo["is"+t] = false; 
     67        } 
     68})(); 
     69 
    8270 
    8371// Override locale setting, if specified 
    84 dojo.locale  = djConfig.locale; 
     72dojo.locale = djConfig.locale; 
     73 
     74dojo._baseUrl = "./"; 
    8575 
    8676//TODOC:  HOW TO DOC THIS? 
     
    113103        //              Optional. Returns an object with two properties, 'obj' and 'prop'. 
    114104        //              'obj[prop]' is the reference indicated by 'name'. 
    115         var tobj, tprop; 
    116         if(typeof name != "string"){ 
    117                 // clearly an error 
    118                 // FIXME: why is this here? 
    119                 return undefined; // Undefined 
    120         } 
    121         tobj = obj; 
    122         if(!tobj){ tobj = dojo.global(); } 
     105        var tprop, tobj = obj||dojo.global(); 
    123106        var parts=name.split("."), i=0, lobj, tmp, tname; 
    124107        do{ 
     
    148131        //              Optional. Object to use as root of path. Defaults to 
    149132        //              'dojo.global()'. Null may be passed. 
    150         if(typeof obj == "string"){ 
    151                 // back-compat, should be removed at some point 
    152                 dojo.deprecated("dojo.exists(obj, name)", "use dojo.exists(name, obj, /*optional*/create)", "0.6"); 
    153                 // swap them 
    154                 var tmp = name; 
    155                 name = obj; 
    156                 obj = tmp; 
    157         } 
    158133        return (!!dojo.getObject(name, false, obj)); // Boolean 
    159 } 
    160  
    161 dojo.evalProp = function(/*String*/name, /*Object*/object, /*Boolean?*/create){ 
    162         // summary:  
    163         //              DEPRECATED. Returns 'object[name]'.  If not defined and 'create' is 
    164         //              true, will return a new Object. 
    165         // description: 
    166         //              Returns null if 'object[name]' is not defined and 'create' is not true. 
    167         //              Note: 'defined' and 'exists' are not the same concept. 
    168         dojo.deprecated("dojo.evalProp", "just use hash syntax. Sheesh.", "0.6"); 
    169         return object[name] || (create ? (object[name]={}) : undefined);        // mixed 
    170 } 
    171  
    172 dojo.parseObjPath = function(/*String*/ path, /*Object?*/ context, /*Boolean?*/ create){ 
    173         // summary:  
    174         //              DEPRECATED. Parse string path to an object, and return 
    175         //              corresponding object reference and property name. 
    176         // description: 
    177         //              Returns an object with two properties, 'obj' and 'prop'. 
    178         //              'obj[prop]' is the reference indicated by 'path'. 
    179         // path: Path to an object, in the form "A.B.C". 
    180         // context: Object to use as root of path.  Defaults to 'dojo.global()'. 
    181         // create:  
    182         //              If true, Objects will be created at any point along the 'path' that 
    183         //              is undefined. 
    184         dojo.deprecated("dojo.parseObjPath", "use dojo.getObject(path, create, context, true)", "0.6"); 
    185         return dojo.getObject(path, create, context, true); // Object: {obj: Object, prop: String} 
    186 } 
    187  
    188 dojo.evalObjPath = function(/*String*/path, /*Boolean?*/create){ 
    189         // summary:  
    190         //              DEPRECATED. Return the value of object at 'path' in the global 
    191         //              scope, without using 'eval()'. 
    192         // path: Path to an object, in the form "A.B.C". 
    193         // create:  
    194         //              If true, Objects will be created at any point along the 'path' that 
    195         //              is undefined. 
    196         dojo.deprecated("dojo.evalObjPath", "use dojo.getObject(path, create)", "0.6"); 
    197         return dojo.getObject(path, create); // Object 
    198 } 
    199  
    200 dojo.errorToString = function(/*Error*/ exception){ 
    201         // summary: Return an exception's 'message', 'description' or text. 
    202  
    203         // TODO: overriding Error.prototype.toString won't accomplish this? 
    204         //              ... since natively generated Error objects do not always reflect such things? 
    205         /* 
    206         if(!dj_undef("message", exception)){ 
    207                 return exception.message;               // String 
    208         }else if(!dj_undef("description", exception)){ 
    209                 return exception.description;   // String 
    210         }else{ 
    211                 return exception;                               // Error 
    212         } 
    213         */ 
    214         return (exception["message"]||exception["description"]||exception); 
    215 } 
    216  
    217 dojo.raise = function(/*String*/ message, /*Error?*/ exception){ 
    218         // summary: 
    219         //              Common point for raising exceptions in Dojo to enable logging. 
    220         //              Throws an error message with text of 'exception' if provided, or 
    221         //              rethrows exception object. 
    222  
    223         if(exception){ 
    224                 message = message + ": "+dojo.errorToString(exception); 
    225         }else{ 
    226                 message = dojo.errorToString(message); 
    227         } 
    228  
    229         // print the message to the user if hostenv.println is defined 
    230         try{  
    231                 if(djConfig.isDebug){ 
    232                         dojo.hostenv.println("FATAL exception raised: "+message); 
    233                 } 
    234         }catch(e){} 
    235  
    236         throw exception || Error(message); 
    237134} 
    238135 
     
    248145}; 
    249146 
    250 function dj_eval(/*String*/ scriptFragment){ 
     147dojo["eval"] = function(/*String*/ scriptFragment){ 
    251148        // summary:  
    252149        //              Perform an evaluation in the global scope.  Use this rather than 
     
    259156        //       - Mozilla/SpiderMonkey eval() takes an optional second argument which is the 
    260157        //       scope object for new symbols. 
    261         return dj_global.eval ? dj_global.eval(scriptFragment) : eval(scriptFragment);  // mixed 
    262 } 
    263  
    264 dojo.unimplemented = function(/*String*/ funcname, /*String?*/ extra){ 
    265         // summary: Throw an exception because some function is not implemented. 
    266         // extra: Text to append to the exception message. 
    267         var message = "'" + funcname + "' not implemented"; 
    268         if(extra != null){ message += " " + extra; } 
    269         dojo.raise(message); 
     158        return dojo.global().eval ? dojo.global().eval(scriptFragment) : eval(scriptFragment);  // mixed 
    270159} 
    271160 
     
    283172} 
    284173 
    285 dojo.render = (function(){ 
    286         //      summary:  
    287         //              Builds the dojo.render object which details rendering support, OS 
    288         //              and browser of the current environment. 
     174dojo.experimental = function(/* String */ moduleName, /* String? */ extra){ 
     175        // summary: Marks code as experimental. 
     176        // description:  
     177        //              This can be used to mark a function, file, or module as 
     178        //              experimental.  Experimental code is not ready to be used, and the 
     179        //              APIs are subject to change without notice.  Experimental code may be 
     180        //              completed deleted without going through the normal deprecation 
     181        //              process. 
     182        // moduleName:  
     183        //              The name of a module, or the name of a module file or a specific 
     184        //              function 
     185        // extra:  
     186        //              some additional message for the user 
     187        // examples: 
     188        //              dojo.experimental("dojo.data.Result"); 
     189        //              dojo.experimental("dojo.weather.toKelvin()", "PENDING approval from NOAA"); 
     190        var message = "EXPERIMENTAL: " + moduleName; 
     191        message += " -- Not yet ready for use.  APIs subject to change without notice."; 
     192        if(extra){ message += " " + extra; } 
     193        dojo.debug(message); 
     194} 
     195 
     196dojo._getText = function(/*String*/ uri){ 
     197        //      summary:         
     198        //              Read the plain/text contents at the specified 'uri'. 
    289199        //      description: 
    290         //              commonly used properties of dojo.render (in HTML environments) 
    291         //              include: 
    292         // 
    293         //                      dojo.render.html.ie 
    294         //                      dojo.render.html.opera 
    295         //                      dojo.render.html.khtml 
    296         //                      dojo.render.html.safari 
    297         //                      dojo.render.html.moz 
    298         //                      dojo.render.html.mozilla 
    299         // 
    300         //              additional objects are provided to detail support for other types 
    301         //              of media and environments. For instance, the following determines 
    302         //              if there's native SVG support in a browser: 
    303         //                       
    304         //                      if(dojo.render.svg.capable && dojo.render.svg.builtin){ 
    305         //                              ... 
    306         //                      } 
    307         // 
    308         //              Other properties of note: 
    309         // 
    310         //                      dojo.render.os.win 
    311         //                      dojo.render.os.osx 
    312         //                      dojo.render.os.linux 
    313         //                      dojo.render.html.UA (navigator.userAgent) 
    314         //                      dojo.render.html.AV (navigator.appVersion) 
    315         //                      dojo.render.html.ie50 (MSIE 5.0) 
    316         //                      dojo.render.html.ie55 (MSIE 5.5) 
    317         //                      dojo.render.html.ie60 (MSIE 6.0) 
    318         //                      dojo.render.html.ie70 (MSIE 7.0) 
    319         // 
    320         //              All reasonable measures are taken to ensure that the values in 
    321         //              dojo.render represent the real environment and not, say, a browser 
    322         //              "masquerading" as a different browser version. Only supported 
    323         //              environments and browsers will likely have entires in dojo.render. 
    324         function vscaffold(prefs, names){ 
    325                 var tmp = { 
    326                         capable: false, 
    327                         support: { 
    328                                 builtin: false, 
    329                                 plugin: false 
    330                         }, 
    331                         prefixes: prefs 
    332                 }; 
    333                 for(var i=0; i<names.length; i++){ 
    334                         tmp[names[i]] = false; 
    335                 } 
    336                 return tmp; 
    337         } 
    338  
    339         return { 
    340                 name: "", 
    341                 ver: dojo.version, 
    342                 os: { win: false, linux: false, osx: false }, 
    343                 html: vscaffold(["html"], ["ie", "opera", "khtml", "safari", "moz"]), 
    344                 svg: vscaffold(["svg"], ["corel", "adobe", "batik"]), 
    345                 vml: vscaffold(["vml"], ["ie"]), 
    346                 swf: vscaffold(["Swf", "Flash", "Mm"], ["mm"]), 
    347                 swt: vscaffold(["Swt"], ["ibm"]) 
    348         }; 
    349 })(); 
    350  
    351 // **************************************************************** 
    352 // dojo.hostenv methods that must be defined in hostenv_*.js 
    353 // **************************************************************** 
    354  
    355 /** 
    356  * The interface definining the interaction with the EcmaScript host environment. 
    357 */ 
    358  
    359 /* 
    360  * None of these methods should ever be called directly by library users. 
    361  * Instead public methods such as loadModule should be called instead. 
    362  */ 
    363 dojo.hostenv = (function(){ 
    364         // TODOC:  HOW TO DOC THIS? 
    365         // summary:  
    366         //              Provides encapsulation of behavior that changes across different 
    367         //              'host environments' (different browsers, server via Rhino, etc). 
    368         // description:  
    369         //              None of these methods should ever be called directly by library 
    370         //              users.  Use public methods such as 'loadModule' instead. 
    371  
    372         // default configuration options 
    373         var config = { 
    374                 isDebug: false, 
    375                 allowQueryConfig: false, 
    376                 baseScriptUri: "", 
    377                 baseRelativePath: "", 
    378                 libraryScriptUri: "", 
    379                 iePreventClobber: false, 
    380                 ieClobberMinimal: true, 
    381                 preventBackButtonFix: true, 
    382                 delayMozLoadingFix: false, 
    383                 searchIds: [], 
    384                 parseWidgets: true 
    385         }; 
    386  
    387         if(typeof djConfig == "undefined"){ 
    388                 djConfig = config; 
    389         }else{ 
    390                 for(var option in config){ 
    391                         if(typeof djConfig[option] == "undefined"){ 
    392                                 djConfig[option] = config[option]; 
    393                         } 
    394                 } 
    395         } 
    396  
    397         return { 
    398                 name_: '(unset)', 
    399                 version_: '(unset)', 
    400  
    401  
    402                 getName: function(){ 
    403                         // sumary: Return the name of the host environment. 
    404                         return this.name_;      // String 
    405                 }, 
    406  
    407  
    408                 getVersion: function(){ 
    409                         // summary: Return the version of the hostenv. 
    410                         return this.version_; // String 
    411                 }, 
    412  
    413                 getText: function(/*String*/ uri){ 
    414                         //      summary:         
    415                         //              Read the plain/text contents at the specified 'uri'. 
    416                         //      description: 
    417                         //              If 'getText()' is not implemented, then it is necessary to 
    418                         //              override 'loadUri()' with an implementation that doesn't 
    419                         //              rely on it. 
    420                         dojo.unimplemented('getText', "uri=" + uri); 
    421                 } 
    422         }; 
    423 })(); 
    424  
    425  
    426 dojo.hostenv.getBaseScriptUri = function(){ 
    427         // summary:  
    428         //              Return the base script uri that other scripts are found relative to. 
    429         //              MAYBE:  Return the base uri to scripts in the dojo library.      ??? 
    430         // return: Empty string or a path ending in '/'. 
    431  
    432  
    433         // TODOC:  
    434         //              HUH? This comment means nothing to me. What other scripts? Is 
    435         //              this the path to other dojo libraries? 
    436         if(djConfig.baseScriptUri.length){ 
    437                 return djConfig.baseScriptUri; 
    438         } 
    439  
    440         // MOW: Why not: 
    441         //                      uri = djConfig.libraryScriptUri || djConfig.baseRelativePath 
    442         //              ??? Why 'new String(...)' 
    443         var uri = new String(djConfig.libraryScriptUri||djConfig.baseRelativePath); 
    444         if(!uri){  
    445                 dojo.raise("Nothing returned by getLibraryScriptUri(): " + uri); 
    446         } 
    447         // MOW:  
    448         //              uri seems to not be actually used.  Seems to be hard-coding to 
    449         //              djConfig.baseRelativePath... ??? 
    450  
    451         djConfig.baseScriptUri = djConfig.baseRelativePath; 
    452         return djConfig.baseScriptUri;  // String 
    453 } 
     200        //              If 'getText()' is not implemented, then it is necessary to 
     201        //              override 'loadUri()' with an implementation that doesn't 
     202        //              rely on it. 
     203 
     204        // NOTE: platform specializations need to implement this 
     205} 
     206 
    454207// vim:ai:ts=4:noet:textwidth=80 
  • dojo/trunk/_base/_loader/hostenv_rhino.js

    r7643 r7649  
    22* Rhino host environment 
    33*/ 
    4 // make jsc shut up (so we can use jsc for sanity checking)  
    5 /*@cc_on 
    6 @if (@_jscript_version >= 7) 
    7 var loadClass; var print; var load; var quit; var version; var Packages; var java; 
    8 @end 
    9 @*/ 
    10  
     4 
     5/* 
    116dojo.hostenv.println=function(line){ 
    127        if(arguments.length > 0){ 
     
    2318        } 
    2419} 
     20*/ 
    2521 
    2622dojo.locale = dojo.locale || String(java.util.Locale.getDefault().toString().replace('_','-').toLowerCase()); 
    27 dojo.render.name = dojo.hostenv.name_ = 'rhino'; 
    28 dojo.hostenv.getVersion = function() {return version();}; 
    29  
    30 if (dj_undef("byId")) { 
     23dojo._name = 'rhino'; 
     24dojo.isRhino = true; 
     25 
     26if(typeof dojo["byId"] == "undefined"){ 
    3127        dojo.byId = function(id, doc){ 
    3228                if(id && (typeof id == "string" || id instanceof String)){ 
     
    3935 
    4036// see comments in spidermonkey loadUri 
    41 dojo.hostenv.loadUri = function(uri, cb){ 
     37dojo._loadUri = function(uri, cb){ 
    4238        try{ 
    4339                var local = (new java.io.File(uri)).exists(); 
     
    5349                        } 
    5450                } 
    55 //FIXME: Use Rhino 1.6 native readFile/readUrl if available? 
     51                //FIXME: Use Rhino 1.6 native readFile/readUrl if available? 
    5652                if(cb){ 
    5753                        var contents = (local ? readText : readUri)(uri, "UTF-8"); 
     
    6763} 
    6864 
    69 dojo.hostenv.exit = function(exitcode){  
     65dojo.exit = function(exitcode){  
    7066        quit(exitcode); 
    7167} 
     
    119115 
    120116// do it by using java java.lang.Exception 
    121 function dj_rhino_current_script_via_java(depth) { 
     117dojo._rhinoCurrentScriptViaJava = function(depth){ 
    122118    var optLevel = Packages.org.mozilla.javascript.Context.getCurrentContext().getOptimizationLevel();   
    123    // if (optLevel == -1){ dojo.unimplemented("getCurrentScriptURI (determine current script path for rhino when interpreter mode)", ''); } 
    124119    var caw = new java.io.CharArrayWriter(); 
    125120    var pw = new java.io.PrintWriter(caw); 
     
    144139} 
    145140 
    146 // UNUSED: leverage new support in native exception for getSourceName 
    147 /* 
    148 function dj_rhino_current_script_via_eval_exception() { 
    149     var exc; 
    150     // 'ReferenceError: "undefinedsymbol" is not defined.' 
    151     try {eval ("undefinedsymbol()") } catch(e) {exc = e;} 
    152     // 'Error: whatever' 
    153     // try{throw Error("whatever");} catch(e) {exc = e;} 
    154     // 'SyntaxError: identifier is a reserved word' 
    155     // try {eval ("static in return")} catch(e) { exc = e; } 
    156    // print("got exception: '" + exc + "' type=" + (typeof exc)); 
    157     // print("exc.stack=" + (typeof exc.stack)); 
    158     var sn = exc.rhinoException.getSourceName(); 
    159     print("SourceName=" + sn); 
    160     return sn; 
    161 }*/ 
    162  
    163141// reading a file from disk in Java is a humiliating experience by any measure. 
    164142// Lets avoid that and just get the freaking text 
     
    197175if(!djConfig.libraryScriptUri.length){ 
    198176        try{ 
    199                 djConfig.libraryScriptUri = dj_rhino_current_script_via_java(1); 
     177                djConfig.libraryScriptUri = dojo._rhinoCurrentScriptViaJava(1); 
    200178        }catch(e){ 
    201179                // otherwise just fake it 
  • dojo/trunk/_base/_loader/hostenv_spidermonkey.js

    r7644 r7649  
    33 */ 
    44 
    5 dojo.hostenv.name_ = 'spidermonkey'; 
    6  
    7 dojo.hostenv.println = print; 
    8 dojo.hostenv.exit = function(exitcode){  
     5dojo._name = 'spidermonkey'; 
     6dojo.isSpidermonkey = true; 
     7dojo.exit = function(exitcode){  
    98        quit(exitcode);  
    109} 
    1110 
    12 // version() returns 0, sigh. and build() returns nothing but just prints. 
    13 dojo.hostenv.getVersion = function(){ return version(); } 
    14  
    15 // make jsc shut up (so we can use jsc for sanity checking)  
    16 /*@cc_on 
    17 @if (@_jscript_version >= 7) 
    18 var line2pc; var print; var load; var quit; 
    19 @end 
    20 @*/ 
    21  
    2211if(typeof line2pc == 'undefined'){ 
    23         dojo.raise("attempt to use SpiderMonkey host environment when no 'line2pc' global"); 
     12        throw new Error("attempt to use SpiderMonkey host environment when no 'line2pc' global"); 
    2413} 
    2514 
    26 /* 
    27  * This is a hack that determines the current script file by parsing a generated 
    28  * stack trace (relying on the non-standard "stack" member variable of the 
    29  * SpiderMonkey Error object). 
    30  * If param depth is passed in, it'll return the script file which is that far down 
    31  * the stack, but that does require that you know how deep your stack is when you are 
    32  * calling. 
    33  */ 
    34 function dj_spidermonkey_current_file(depth){ 
     15dojo._spidermonkeyCurrentFile = function(depth){ 
     16        //       
     17        //      This is a hack that determines the current script file by parsing a 
     18        //      generated stack trace (relying on the non-standard "stack" member variable 
     19        //      of the SpiderMonkey Error object). 
     20        //       
     21        //      If param depth is passed in, it'll return the script file which is that far down 
     22        //      the stack, but that does require that you know how deep your stack is when you are 
     23        //      calling. 
     24        //       
    3525    var s = ''; 
    3626    try{ 
     
    4232    var matches = s.match(/[^@]*\.js/gi); 
    4333    if(!matches){  
    44                 dojo.raise("could not parse stack string: '" + s + "'"); 
     34                throw Error("could not parse stack string: '" + s + "'"); 
    4535        } 
    4636    var fname = (typeof depth != 'undefined' && depth) ? matches[depth + 1] : matches[matches.length - 1]; 
    4737    if(!fname){  
    48                 dojo.raise("could not find file name in stack string '" + s + "'"); 
     38                throw Error("could not find file name in stack string '" + s + "'"); 
    4939        } 
    5040    //print("SpiderMonkeyRuntime got fname '" + fname + "' from stack string '" + s + "'"); 
     
    5242} 
    5343 
    54 // call this now because later we may not be on the top of the stack 
    55 if(!dojo.hostenv.library_script_uri_){  
    56         dojo.hostenv.library_script_uri_ = dj_spidermonkey_current_file(0);  
    57 } 
     44// print(dojo._spidermonkeyCurrentFile(0));  
    5845 
    59 dojo.hostenv.loadUri = function(uri){ 
     46dojo._loadUri = function(uri){ 
    6047        // spidermonkey load() evaluates the contents into the global scope (which 
    6148        // is what we want). 
  • dojo/trunk/_base/_loader/loader.js

    r7647 r7649