A question about Loader baseURL

Shijun He hax.sfo at gmail.com
Mon Aug 27 03:32:45 PDT 2012


It seems current loader spec is so simple and I'm full of confusion of
baseURL props.


// lib/a.js

System.baseURL // "lib/a.js" ??
System.load('b.js', ...)  // I suppose this should load "lib/b.js", right?

var myLoader = new Loader(System, { baseURL: 'mypath/c.js' , fetch:myFetch })

myLoader.baseURL // 'mypath/c.js' or 'lib/mypath/c.js' or any other value?
myLoader.load('b.js' ...) // load 'lib/mypath/b.js' or 'lib/b.js' ?

function myFetch(relURL, baseURL, ...) {
    relURL // 'b.js' or 'mypath/b.js' or any other value?
    baseURL // ?
}

and what happens if I call myLoader in other code for example which
url is '/otherpath/' ?


--
hax


More information about the es-discuss mailing list