Ticket #627: bootstrapRefactor.patch

File bootstrapRefactor.patch, 76.3 kB (added by jburke, 3 years ago)

Patch to trunk to refactor bootstrap files.

  • src/text/Text.js

     
    1 dj_deprecated("dojo.text.Text is being replaced by dojo.string"); 
     1dojo.deprecated("dojo.text.Text is being replaced by dojo.string"); 
    22dojo.require("dojo.string"); 
    33 
    44dojo.text = dojo.string; 
  • src/text/Builder.js

     
    11dojo.provide("dojo.text.Builder"); 
    22dojo.require("dojo.string.Builder"); 
    33 
    4 dj_deprecated("dojo.text.Builder is deprecated, use dojo.string.Builder instead"); 
     4dojo.deprecated("dojo.text.Builder is deprecated, use dojo.string.Builder instead"); 
    55 
    66dojo.text.Builder = dojo.string.Builder; 
  • src/text/String.js

     
    1 dj_deprecated("dojo.text.String is being replaced by dojo.string"); 
     1dojo.deprecated("dojo.text.String is being replaced by dojo.string"); 
    22dojo.require("dojo.string"); 
    33 
    44dojo.text = dojo.string; 
  • src/hostenv_rhino.js

     
    1010@*/ 
    1111 
    1212// TODO: not sure what we gain from the next line, anyone? 
    13 //if (typeof loadClass == 'undefined') { dj_throw("attempt to use Rhino host environment when no 'loadClass' global"); } 
     13//if (typeof loadClass == 'undefined') { dojo.raise("attempt to use Rhino host environment when no 'loadClass' global"); } 
    1414 
    1515dojo.render.name = dojo.hostenv.name_ = 'rhino'; 
    1616dojo.hostenv.getVersion = function() {return version()}; 
     
    101101// do it by using java java.lang.Exception 
    102102function dj_rhino_current_script_via_java(depth) { 
    103103    var optLevel = Packages.org.mozilla.javascript.Context.getCurrentContext().getOptimizationLevel();   
    104     if (optLevel == -1) dj_unimplemented("getCurrentScriptURI (determine current script path for rhino when interpreter mode)", ''); 
     104    if (optLevel == -1) dojo.unimplemented("getCurrentScriptURI (determine current script path for rhino when interpreter mode)", ''); 
    105105    var caw = new java.io.CharArrayWriter(); 
    106106    var pw = new java.io.PrintWriter(caw); 
    107107    var exc = new java.lang.Exception(); 
  • src/hostenv_jsc.js

     
    99// See the Rotor source code jscript/engine/globalobject.cs for what globals 
    1010// are available. 
    1111if((typeof ScriptEngineMajorVersion != 'function')||(ScriptEngineMajorVersion() < 7)){ 
    12         dj_throw("attempt to use JScript .NET host environment with inappropriate ScriptEngine");  
     12        dojo.raise("attempt to use JScript .NET host environment with inappropriate ScriptEngine");  
    1313} 
    1414 
    1515// for more than you wanted to know about why this import is required even if 
     
    1919 
    2020dojo.hostenv.getText = function(uri){ 
    2121        if(!System.IO.File.Exists(uri)){ 
    22                 // dj_throw("No such file '" + uri + "'"); 
     22                // dojo.raise("No such file '" + uri + "'"); 
    2323                return 0; 
    2424        } 
    2525        var reader = new System.IO.StreamReader(uri); 
     
    3030dojo.hostenv.loadUri = function(uri){ 
    3131        var contents = this.getText(uri); 
    3232        if(!contents){ 
    33                 dj_throw("got no back contents from uri '" + uri + "': " + contents); 
     33                dojo.raise("got no back contents from uri '" + uri + "': " + contents); 
    3434        } 
    3535        // TODO: in JScript .NET, eval will not affect the symbol table of the current code? 
    3636        var value = dj_eval(contents); 
  • src/browser_debug.js

     
    11dojo.hostenv.loadedUris.push("../src/bootstrap1.js"); 
     2dojo.hostenv.loadedUris.push("../src/bootstrap2.js"); 
    23dojo.hostenv.loadedUris.push("../src/hostenv_browser.js"); 
    3 dojo.hostenv.loadedUris.push("../src/bootstrap2.js"); 
    44 
    55function removeComments(contents){ 
    66        contents = new String((!contents) ? "" : contents); 
     
    1414dojo.hostenv.getRequiresAndProvides = function(contents){ 
    1515        // FIXME: should probably memoize this! 
    1616        if(!contents){ return []; } 
     17         
    1718 
    1819        // check to see if we need to load anything else first. Ugg. 
    1920        var deps = []; 
    2021        var tmp; 
    2122        RegExp.lastIndex = 0; 
    22         var testExp = /dojo.(hostenv.loadModule|hosetnv.require|require|requireIf|hostenv.conditionalLoadModule|hostenv.startPackage|hostenv.provide|provide)\([\w\W]*?\)/mg; 
     23        var testExp = /dojo.(hostenv.loadModule|hosetnv.require|require|requireIf|hostenv.conditionalLoadModule|hostenv.startPackage|provide)\([\w\W]*?\)/mg; 
    2324        while((tmp = testExp.exec(contents)) != null){ 
    2425                deps.push(tmp[0]); 
    2526        } 
     
    3435        var deps = []; 
    3536        var tmp; 
    3637        RegExp.lastIndex = 0; 
    37         var testExp = /dojo.(requireAfterIf|requireAfter)\([\w\W]*?\)/mg; 
     38        var testExp = /dojo.(requireAfterIf|requireIf)\([\w\W]*?\)/mg; 
    3839        while((tmp = testExp.exec(contents)) != null){ 
    3940                deps.push(tmp[0]); 
    4041        } 
  • src/bootstrap2.js

     
    11/* 
    2  * bootstrap2.js - runs after the hostenv_*.js file. 
     2 * bootstrap2.js - runs before the hostenv_*.js file. Contains all of the package loading methods. 
    33 */ 
    44 
     5//Additional properties for dojo.hostenv 
     6var _addHostEnv = { 
     7        pkgFileName: "__package__", 
     8 
     9        // for recursion protection 
     10        loading_modules_: {}, 
     11        loaded_modules_: {}, 
     12        addedToLoadingCount: [], 
     13        removedFromLoadingCount: [], 
     14 
     15        inFlightCount: 0, 
     16 
     17        // FIXME: it should be possible to pull module prefixes in from djConfig 
     18        modulePrefixes_: { 
     19                dojo: {name: "dojo", value: "src"} 
     20        }, 
     21 
     22 
     23        setModulePrefix: function(module, prefix){ 
     24                this.modulePrefixes_[module] = {name: module, value: prefix}; 
     25        }, 
     26 
     27        getModulePrefix: function(module){ 
     28                var mp = this.modulePrefixes_; 
     29                if((mp[module])&&(mp[module]["name"])){ 
     30                        return mp[module].value; 
     31                } 
     32                return module; 
     33        }, 
     34 
     35        getTextStack: [], 
     36        loadUriStack: [], 
     37        loadedUris: [], 
     38 
     39        //WARNING: This variable is referenced by packages outside of bootstrap: FloatingPane.js and undo/browser.js 
     40        post_load_: false, 
     41         
     42        //Egad! Lots of test files push on this directly instead of using dojo.addOnLoad. 
     43        modulesLoadedListeners: [], 
     44} 
     45 
     46//Add all of these properties to dojo.hostenv 
     47for(var param in _addHostEnv){ 
     48        dojo.hostenv[param] = _addHostEnv[param]; 
     49} 
     50                               
     51/** 
     52 * Loads and interprets the script located at relpath, which is relative to the 
     53 * script root directory.  If the script is found but its interpretation causes 
     54 * a runtime exception, that exception is not caught by us, so the caller will 
     55 * see it.  We return a true value if and only if the script is found. 
     56 * 
     57 * For now, we do not have an implementation of a true search path.  We 
     58 * consider only the single base script uri, as returned by getBaseScriptUri(). 
     59 * 
     60 * @param relpath A relative path to a script (no leading '/', and typically 
     61 * ending in '.js'). 
     62 * @param module A module whose existance to check for after loading a path. 
     63 * Can be used to determine success or failure of the load. 
     64 */ 
     65dojo.hostenv.loadPath = function(relpath, module /*optional*/, cb /*optional*/){ 
     66        if((relpath.charAt(0) == '/')||(relpath.match(/^\w+:/))){ 
     67                dojo.raise("relpath '" + relpath + "'; must be relative"); 
     68        } 
     69        var uri = this.getBaseScriptUri() + relpath; 
     70        if(djConfig.cacheBust && dojo.render.html.capable) { uri += "?" + String(djConfig.cacheBust).replace(/\W+/g,""); } 
     71        try{ 
     72                return ((!module) ? this.loadUri(uri, cb) : this.loadUriAndCheck(uri, module, cb)); 
     73        }catch(e){ 
     74                dojo.debug(e); 
     75                return false; 
     76        } 
     77} 
     78 
     79/** 
     80 * Reads the contents of the URI, and evaluates the contents. 
     81 * Returns true if it succeeded. Returns false if the URI reading failed. 
     82 * Throws if the evaluation throws. 
     83 * The result of the eval is not available to the caller. 
     84 */ 
     85dojo.hostenv.loadUri = function(uri, cb){ 
     86        if(this.loadedUris[uri]){ 
     87                return; 
     88        } 
     89        var contents = this.getText(uri, null, true); 
     90        if(contents == null){ return 0; } 
     91        this.loadedUris[uri] = true; 
     92        var value = dj_eval(contents); 
     93        return 1; 
     94} 
     95 
     96// FIXME: probably need to add logging to this method 
     97dojo.hostenv.loadUriAndCheck = function(uri, module, cb){ 
     98        var ok = true; 
     99        try{ 
     100                ok = this.loadUri(uri, cb); 
     101        }catch(e){ 
     102                dojo.debug("failed loading ", uri, " with error: ", e); 
     103        } 
     104        return ((ok)&&(this.findModule(module, false))) ? true : false; 
     105} 
     106 
     107dojo.loaded = function(){ } 
     108 
     109dojo.hostenv.loaded = function(){ 
     110        this.post_load_ = true; 
     111        var mll = this.modulesLoadedListeners; 
     112        for(var x=0; x<mll.length; x++){ 
     113                mll[x](); 
     114        } 
     115        dojo.loaded(); 
     116} 
     117 
    5118/* 
     119Call styles: 
     120        dojo.addOnLoad(functionPointer) 
     121        dojo.addOnLoad(object, "functionName") 
     122*/ 
     123dojo.addOnLoad = function(obj, fcnName) { 
     124        if(arguments.length == 1) { 
     125                dojo.hostenv.modulesLoadedListeners.push(obj); 
     126        } else if(arguments.length > 1) { 
     127                dojo.hostenv.modulesLoadedListeners.push(function() { 
     128                        obj[fcnName](); 
     129                }); 
     130        } 
     131} 
     132 
     133dojo.hostenv.modulesLoaded = function(){ 
     134        if(this.post_load_){ return; } 
     135        if((this.loadUriStack.length==0)&&(this.getTextStack.length==0)){ 
     136                if(this.inFlightCount > 0){  
     137                        dojo.debug("files still in flight!"); 
     138                        return; 
     139                } 
     140                if(typeof setTimeout == "object"){ 
     141                        setTimeout("dojo.hostenv.loaded();", 0); 
     142                }else{ 
     143                        dojo.hostenv.loaded(); 
     144                } 
     145        } 
     146} 
     147 
     148dojo.hostenv.moduleLoaded = function(modulename){ 
     149        var modref = dojo.evalObjPath((modulename.split(".").slice(0, -1)).join('.')); 
     150        this.loaded_modules_[(new String(modulename)).toLowerCase()] = modref; 
     151} 
     152 
     153/** 
     154* loadModule("A.B") first checks to see if symbol A.B is defined.  
     155* If it is, it is simply returned (nothing to do). 
     156* 
     157* If it is not defined, it will look for "A/B.js" in the script root directory, 
     158* followed by "A.js". 
     159* 
     160* It throws if it cannot find a file to load, or if the symbol A.B is not 
     161* defined after loading. 
     162* 
     163* It returns the object A.B. 
     164* 
     165* This does nothing about importing symbols into the current package. 
     166* It is presumed that the caller will take care of that. For example, to import 
     167* all symbols: 
     168* 
     169*    with (dojo.hostenv.loadModule("A.B")) { 
     170*       ... 
     171*    } 
     172* 
     173* And to import just the leaf symbol: 
     174* 
     175*    var B = dojo.hostenv.loadModule("A.B"); 
     176*    ... 
     177* 
     178* dj_load is an alias for dojo.hostenv.loadModule 
     179*/ 
     180dojo.hostenv._global_omit_module_check = false; 
     181dojo.hostenv.loadModule = function(modulename, exact_only, omit_module_check){ 
     182        if(!modulename){ return; } 
     183        omit_module_check = this._global_omit_module_check || omit_module_check; 
     184        var module = this.findModule(modulename, false); 
     185        if(module){ 
     186                return module; 
     187        } 
     188 
     189        // protect against infinite recursion from mutual dependencies 
     190        if(dj_undef(modulename, this.loading_modules_)){ 
     191                this.addedToLoadingCount.push(modulename); 
     192        } 
     193        this.loading_modules_[modulename] = 1; 
     194 
     195        // convert periods to slashes 
     196        var relpath = modulename.replace(/\./g, '/') + '.js'; 
     197 
     198        var syms = modulename.split("."); 
     199        var nsyms = modulename.split("."); 
     200        for (var i = syms.length - 1; i > 0; i--) { 
     201                var parentModule = syms.slice(0, i).join("."); 
     202                var parentModulePath = this.getModulePrefix(parentModule); 
     203                if (parentModulePath != parentModule) { 
     204                        syms.splice(0, i, parentModulePath); 
     205                        break; 
     206                } 
     207        } 
     208        var last = syms[syms.length - 1]; 
     209        // figure out if we're looking for a full package, if so, we want to do 
     210        // things slightly diffrently 
     211        if(last=="*"){ 
     212                modulename = (nsyms.slice(0, -1)).join('.'); 
     213 
     214                while(syms.length){ 
     215                        syms.pop(); 
     216                        syms.push(this.pkgFileName); 
     217                        relpath = syms.join("/") + '.js'; 
     218                        if(relpath.charAt(0)=="/"){ 
     219                                relpath = relpath.slice(1); 
     220                        } 
     221                        ok = this.loadPath(relpath, ((!omit_module_check) ? modulename : null)); 
     222                        if(ok){ break; } 
     223                        syms.pop(); 
     224                } 
     225        }else{ 
     226                relpath = syms.join("/") + '.js'; 
     227                modulename = nsyms.join('.'); 
     228                var ok = this.loadPath(relpath, ((!omit_module_check) ? modulename : null)); 
     229                if((!ok)&&(!exact_only)){ 
     230                        syms.pop(); 
     231                        while(syms.length){ 
     232                                relpath = syms.join('/') + '.js'; 
     233                                ok = this.loadPath(relpath, ((!omit_module_check) ? modulename : null)); 
     234                                if(ok){ break; } 
     235                                syms.pop(); 
     236                                relpath = syms.join('/') + '/'+this.pkgFileName+'.js'; 
     237                                if(relpath.charAt(0)=="/"){ 
     238                                        relpath = relpath.slice(1); 
     239                                } 
     240                                ok = this.loadPath(relpath, ((!omit_module_check) ? modulename : null)); 
     241                                if(ok){ break; } 
     242                        } 
     243                } 
     244 
     245                if((!ok)&&(!omit_module_check)){ 
     246                        dojo.raise("Could not load '" + modulename + "'; last tried '" + relpath + "'"); 
     247                } 
     248        } 
     249 
     250        // check that the symbol was defined 
     251        if(!omit_module_check){ 
     252                // pass in false so we can give better error 
     253                module = this.findModule(modulename, false); 
     254                if(!module){ 
     255                        dojo.raise("symbol '" + modulename + "' is not defined after loading '" + relpath + "'");  
     256                } 
     257        } 
     258 
     259        return module; 
     260} 
     261 
     262/** 
     263* startPackage("A.B") follows the path, and at each level creates a new empty 
     264* object or uses what already exists. It returns the result. 
     265*/ 
     266dojo.hostenv.startPackage = function(packname){ 
     267        var syms = packname.split(/\./); 
     268        if(syms[syms.length-1]=="*"){ 
     269                syms.pop(); 
     270        } 
     271        return dojo.evalObjPath(syms.join("."), true); 
     272} 
     273 
     274/** 
     275 * findModule("A.B") returns the object A.B if it exists, otherwise null. 
     276 * @param modulename A string like 'A.B'. 
     277 * @param must_exist Optional, defualt false. throw instead of returning null 
     278 * if the module does not currently exist. 
     279 */ 
     280dojo.hostenv.findModule = function(modulename, must_exist){ 
     281        // check cache 
     282        /* 
     283        if(!dj_undef(modulename, this.modules_)){ 
     284                return this.modules_[modulename]; 
     285        } 
     286        */ 
     287 
     288        var lmn = (new String(modulename)).toLowerCase(); 
     289 
     290        if(this.loaded_modules_[lmn]){ 
     291                return this.loaded_modules_[lmn]; 
     292        } 
     293 
     294        // see if symbol is defined anyway 
     295        var module = dojo.evalObjPath(modulename); 
     296        if((modulename)&&(typeof module != 'undefined')&&(module)){ 
     297                this.loaded_modules_[lmn] = module; 
     298                return module; 
     299        } 
     300 
     301        if(must_exist){ 
     302                dojo.raise("no loaded module named '" + modulename + "'"); 
     303        } 
     304        return null; 
     305} 
     306 
     307//Start of old bootstrap2: 
     308 
     309/* 
    6310 * This method taks a "map" of arrays which one can use to optionally load dojo 
    7311 * modules. The map is indexed by the possible dojo.hostenv.name_ values, with 
    8312 * two additional values: "default" and "common". The items in the "default" 
     
    35339        } 
    36340} 
    37341 
    38 dojo.hostenv.require = dojo.hostenv.loadModule; 
    39342dojo.require = function(){ 
    40343        dojo.hostenv.loadModule.apply(dojo.hostenv, arguments); 
    41344} 
    42 dojo.requireAfter = dojo.require; 
    43345 
    44346dojo.requireIf = function(){ 
    45347        if((arguments[0] === true)||(arguments[0]=="common")||(arguments[0] && dojo.render[arguments[0]].capable)){ 
     
    49351        } 
    50352} 
    51353 
     354//Would like to remove requireAfterIf, but would too many widgets 
     355//outside of dojo use it? Since the dojo widgets used to, and outside 
     356//widgets may have done copy/paste from them to start the widget. 
    52357dojo.requireAfterIf = dojo.requireIf; 
    53 dojo.conditionalRequire = dojo.requireIf; 
    54358 
    55 dojo.requireAll = function() { 
    56         for(var i = 0; i < arguments.length; i++) { dojo.require(arguments[i]); } 
    57 } 
    58  
    59 dojo.kwCompoundRequire = function(){ 
    60         dojo.hostenv.conditionalLoadModule.apply(dojo.hostenv, arguments); 
    61 } 
    62  
    63 dojo.hostenv.provide = dojo.hostenv.startPackage; 
    64359dojo.provide = function(){ 
    65360        return dojo.hostenv.startPackage.apply(dojo.hostenv, arguments); 
    66361} 
     
    69364        return dojo.hostenv.setModulePrefix(module, prefix); 
    70365} 
    71366 
    72 // stub 
    73 dojo.profile = { start: function(){}, end: function(){}, stop: function(){}, dump: function(){} }; 
    74  
    75367// determine if an object supports a given method 
    76368// useful for longer api chains where you have to test each object in the chain 
    77369dojo.exists = function(obj, name){ 
  • src/lang/Lang.js

     
    11dojo.require("dojo.lang"); 
    2 dj_deprecated("dojo.lang.Lang is deprecated, use dojo.lang instead"); 
     2dojo.deprecated("dojo.lang.Lang is deprecated, use dojo.lang instead"); 
  • src/hostenv_wsh.js

     
    1313 
    1414// make sure we are in right environment 
    1515if(typeof WScript == 'undefined'){ 
    16         dj_throw("attempt to use WSH host environment when no WScript global"); 
     16        dojo.raise("attempt to use WSH host environment when no WScript global"); 
    1717} 
    1818 
    1919dojo.hostenv.println = WScript.Echo; 
  • src/reflect/__package__.js

     
    1 dj_deprecated("dojo.reflect is merged into dojo.lang (dojo.lang[type]).  Will be removed by 0.4"); 
     1dojo.deprecated("dojo.reflect is merged into dojo.lang (dojo.lang[type]).  Will be removed by 0.4"); 
    22dojo.hostenv.conditionalLoadModule({ 
    33        common: ["dojo.reflect.reflection"] 
    44}); 
  • src/reflect/reflection.js

     
    1 dj_deprecated("dojo.reflect is merged into dojo.lang (dojo.lang[type]).  Will be removed by 0.4"); 
     1dojo.deprecated("dojo.reflect is merged into dojo.lang (dojo.lang[type]).  Will be removed by 0.4"); 
    22dojo.provide("dojo.reflect"); 
    33 
    44/***************************************************************** 
  • src/graphics/htmlEffects.js

     
    11dojo.provide("dojo.graphics.htmlEffects"); 
    22dojo.require("dojo.fx.*"); 
    33 
    4 dj_deprecated("dojo.graphics.htmlEffects is deprecated, use dojo.fx.html instead"); 
     4dojo.deprecated("dojo.graphics.htmlEffects is deprecated, use dojo.fx.html instead"); 
    55 
    66dojo.graphics.htmlEffects = dojo.fx.html; 
  • src/hostenv_browser.js

     
    3434                } 
    3535        } 
    3636 
    37         if(((djConfig["baseScriptUri"] == "")||(djConfig["baseRelativePath"] == "")) &&(document && document.getElementsByTagName)){ 
    38                 var scripts = document.getElementsByTagName("script"); 
    39                 var rePkg = /(__package__|dojo|bootstrap1)\.js([\?\.]|$)/i; 
    40                 for(var i = 0; i < scripts.length; i++) { 
    41                         var src = scripts[i].getAttribute("src"); 
    42                         if(!src) { continue; } 
    43                         var m = src.match(rePkg); 
    44                         if(m) { 
    45                                 root = src.substring(0, m.index); 
    46                                 if(src.indexOf("bootstrap1") > -1) { root += "../"; } 
    47                                 if(!this["djConfig"]) { djConfig = {}; } 
    48                                 if(djConfig["baseScriptUri"] == "") { djConfig["baseScriptUri"] = root; } 
    49                                 if(djConfig["baseRelativePath"] == "") { djConfig["baseRelativePath"] = root; } 
    50                                 break; 
    51                         } 
    52                 } 
    53         } 
    54  
    5537        // fill in the rendering support information in dojo.render.* 
    5638        var dr = dojo.render; 
    5739        var drh = dojo.render.html; 
     
    373355// breaking when it's not included 
    374356dojo.hostenv.writeIncludes = function(){} 
    375357 
    376 dojo.hostenv.byId = dojo.byId = function(id, doc){ 
     358dojo.byId = function(id, doc){ 
    377359        if(id && (typeof id == "string" || id instanceof String)){ 
    378360                if(!doc){ doc = document; } 
    379361                return doc.getElementById(id); 
    380362        } 
    381363        return id; // assume it's a node 
    382364} 
    383  
    384 dojo.hostenv.byIdArray = dojo.byIdArray = function(){ 
    385         var ids = []; 
    386         for(var i = 0; i < arguments.length; i++){ 
    387                 if((arguments[i] instanceof Array)||(typeof arguments[i] == "array")){ 
    388                         for(var j = 0; j < arguments[i].length; j++){ 
    389                                 ids = ids.concat(dojo.hostenv.byIdArray(arguments[i][j])); 
    390                         } 
    391                 }else{ 
    392                         ids.push(dojo.hostenv.byId(arguments[i])); 
    393                 } 
    394         } 
    395         return ids; 
    396 } 
  • src/bootstrap1.js

     
    122122        throw Error(message); 
    123123} 
    124124 
    125 dj_throw = dj_rethrow = function(m, e){ 
    126         dojo.deprecated("dj_throw and dj_rethrow deprecated, use dojo.raise instead"); 
    127         dojo.raise(m, e); 
    128 } 
     125//Stub functions so things don't break. 
     126dojo.debug = function(){} 
     127dojo.debugShallow = function(obj){} 
     128dojo.profile = { start: function(){}, end: function(){}, stop: function(){}, dump: function(){} }; 
    129129 
    130130/** 
    131  * Produce a line of debug output.  
    132  * Does nothing unless djConfig.isDebug is true. 
    133  * varargs, joined with ''. 
    134  * Caller should not supply a trailing "\n". 
    135  */ 
    136 dojo.debug = function(){ 
    137         if (!djConfig.isDebug) { return; } 
    138         var args = arguments; 
    139         if(dj_undef("println", dojo.hostenv)){ 
    140                 dojo.raise("dojo.debug not available (yet?)"); 
    141         } 
    142         var isJUM = dj_global["jum"] && !dj_global["jum"].isBrowser; 
    143         var s = [(isJUM ? "": "DEBUG: ")]; 
    144         for(var i=0;i<args.length;++i){ 
    145                 if(!false && args[i] instanceof Error){ 
    146                         var msg = "[" + args[i].name + ": " + dojo.errorToString(args[i]) + 
    147                                 (args[i].fileName ? ", file: " + args[i].fileName : "") + 
    148                                 (args[i].lineNumber ? ", line: " + args[i].lineNumber : "") + "]"; 
    149                 } else { 
    150                         try { 
    151                                 var msg = String(args[i]); 
    152                         } catch(e) { 
    153                                 if(dojo.render.html.ie) { 
    154                                         var msg = "[ActiveXObject]"; 
    155                                 } else { 
    156                                         var msg = "[unknown]"; 
    157                                 } 
    158                         } 
    159                 } 
    160                 s.push(msg); 
    161         } 
    162         if(isJUM){ // this seems to be the only way to get JUM to "play nice" 
    163                 jum.debug(s.join(" ")); 
    164         }else{ 
    165                 dojo.hostenv.println(s.join(" ")); 
    166         } 
    167 } 
    168  
    169 /** 
    170  * this is really hacky for now - just  
    171  * display the properties of the object 
    172 **/ 
    173  
    174 dojo.debugShallow = function(obj){ 
    175         if (!djConfig.isDebug) { return; } 
    176         dojo.debug('------------------------------------------------------------'); 
    177         dojo.debug('Object: '+obj); 
    178         var props = []; 
    179         for(var prop in obj){ 
    180                 try { 
    181                         props.push(prop + ': ' + obj[prop]); 
    182                 } catch(E) { 
    183                         props.push(prop + ': ERROR - ' + E.message); 
    184                 } 
    185         } 
    186         props.sort(); 
    187         for(var i = 0; i < props.length; i++) { 
    188                 dojo.debug(props[i]); 
    189         } 
    190         dojo.debug('------------------------------------------------------------'); 
    191 } 
    192  
    193 var dj_debug = dojo.debug; 
    194  
    195 /** 
    196131 * We put eval() in this separate function to keep down the size of the trapped 
    197132 * evaluation context. 
    198133 * 
     
    208143 * Convenience for throwing an exception because some function is not 
    209144 * implemented. 
    210145 */ 
    211 dj_unimplemented = dojo.unimplemented = function(funcname, extra){ 
     146dojo.unimplemented = function(funcname, extra){ 
    212147        // FIXME: need to move this away from dj_* 
    213148        var mess = "'" + funcname + "' not implemented"; 
    214149        if((!dj_undef(extra))&&(extra)){ mess += " " + extra; } 
     
    218153/** 
    219154 * Convenience for informing of deprecated behaviour. 
    220155 */ 
    221 dj_deprecated = dojo.deprecated = function(behaviour, extra, removal){ 
     156dojo.deprecated = function(behaviour, extra, removal){ 
    222157        var mess = "DEPRECATED: " + behaviour; 
    223158        if(extra){ mess += " " + extra; } 
    224159        if(removal){ mess += " -- will be removed in version: " + removal; } 
     
    226161} 
    227162 
    228163/** 
    229  * Convenience for informing of experimental code. 
    230  */ 
    231 dojo.experimental = function(packageName, extra){ 
    232         var mess = "EXPERIMENTAL: " + packageName; 
    233         mess += " -- Not yet ready for use.  APIs subject to change without notice."; 
    234         if(extra){ mess += " " + extra; } 
    235         dojo.debug(mess); 
    236 } 
    237  
    238 /** 
    239164 * Does inheritance 
    240165 */ 
    241166dojo.inherits = function(subclass, superclass){ 
     
    249174        subclass['super'] = superclass.prototype; 
    250175} 
    251176 
    252 dj_inherits = function(subclass, superclass){ 
    253         dojo.deprecated("dj_inherits deprecated, use dojo.inherits instead"); 
    254         dojo.inherits(subclass, superclass); 
    255 } 
    256  
    257177// an object that authors use determine what host we are running under 
    258178dojo.render = (function(){ 
    259179 
     
    321241                } 
    322242        } 
    323243 
    324         var djc = djConfig; 
    325         function _def(obj, name, def){ 
    326                 return (dj_undef(name, obj) ? def : obj[name]); 
    327         } 
    328  
    329244        return {