Changeset 6990

Show
Ignore:
Timestamp:
01/04/07 17:45:19 (23 months ago)
Author:
jburke
Message:

Fixes #2245. Or at least improves our odds of avoiding the Safari [call stack exceeded] error. Now the tooltip and dropdowndatepicker tests work. I might be able to do more optimization of xdTraceReqs and xdEvalReqs, but I will wait for more testing to show an issue.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/loader_xd.js

    r6985 r6990  
    2020        this.xdDepMap = {}; 
    2121        this.xdContents = []; 
     22        this.xdDefList = []; 
    2223} 
    2324 
     
    407408        //summary: Internal xd loader function.  
    408409        //Does a depth first, breadth second search and eval of required modules. 
    409         if(reqChain.length > 0){ 
     410        while(reqChain.length > 0){ 
    410411                var req = reqChain[reqChain.length - 1]; 
    411412                var pkg = this.xdDepMap[req]; 
     
    417418                        var contents = this.xdContents[pkg.contentIndex]; 
    418419                        if(!contents.isDefined){ 
    419                                 //Evaluate the package to bring it into being. 
    420                                 //Pass dojo in so that later, to support multiple versions of dojo 
    421                                 //in a page, we can pass which version of dojo to use. 
    422                                 contents.content(dojo); 
     420                                this.xdDefList.push(contents.content); 
    423421                                contents.isDefined = true; 
    424422                        } 
     
    431429                //Done with that require. Remove it and go to the next one. 
    432430                reqChain.pop(); 
    433                 this.xdEvalReqs(reqChain); 
    434431        } 
    435432} 
     
    473470 
    474471        this.xdWalkReqs(); 
     472         
     473        var defLength = this.xdDefList.length; 
     474        for(var i= 0; i < defLength; i++){ 
     475                //Evaluate the package to bring it into being. 
     476                //Pass dojo in so that later, to support multiple versions of dojo 
     477                //in a page, we can pass which version of dojo to use. 
     478                dojo.hostenv.xdDefList[i](dojo); 
     479        } 
    475480 
    476481        //Evaluate any packages that were not evaled before.