(contextName)
| 197 | } |
| 198 | |
| 199 | function newContext(contextName) { |
| 200 | var inCheckLoaded, Module, context, handlers, |
| 201 | checkLoadedTimeoutId, |
| 202 | config = { |
| 203 | //Defaults. Do not set a default for map |
| 204 | //config to speed up normalize(), which |
| 205 | //will run faster if there is no default. |
| 206 | waitSeconds: 7, |
| 207 | baseUrl: './', |
| 208 | paths: {}, |
| 209 | bundles: {}, |
| 210 | pkgs: {}, |
| 211 | shim: {}, |
| 212 | config: {} |
| 213 | }, |
| 214 | registry = {}, |
| 215 | //registry of just enabled modules, to speed |
| 216 | //cycle breaking code when lots of modules |
| 217 | //are registered, but not activated. |
| 218 | enabledRegistry = {}, |
| 219 | undefEvents = {}, |
| 220 | defQueue = [], |
| 221 | defined = {}, |
| 222 | urlFetched = {}, |
| 223 | bundlesMap = {}, |
| 224 | requireCounter = 1, |
| 225 | unnormalizedCounter = 1; |
| 226 | |
| 227 | /** |
| 228 | * Trims the . and .. from an array of path segments. |
| 229 | * It will keep a leading path segment if a .. will become |
| 230 | * the first path segment, to help with module name lookups, |
| 231 | * which act like paths, but can be remapped. But the end result, |
| 232 | * all paths that use this function should look normalized. |
| 233 | * NOTE: this method MODIFIES the input array. |
| 234 | * @param {Array} ary the array of path segments. |
| 235 | */ |
| 236 | function trimDots(ary) { |
| 237 | var i, part; |
| 238 | for (i = 0; i < ary.length; i++) { |
| 239 | part = ary[i]; |
| 240 | if (part === '.') { |
| 241 | ary.splice(i, 1); |
| 242 | i -= 1; |
| 243 | } else if (part === '..') { |
| 244 | // If at the start, or previous value is still .., |
| 245 | // keep them so that when converted to a path it may |
| 246 | // still work when converted to a path, even though |
| 247 | // as an ID it is less than ideal. In larger point |
| 248 | // releases, may be better to just kick out an error. |
| 249 | if (i === 0 || (i === 1 && ary[2] === '..') || ary[i - 1] === '..') { |
| 250 | continue; |
| 251 | } else if (i > 0) { |
| 252 | ary.splice(i - 1, 2); |
| 253 | i -= 2; |
| 254 | } |
| 255 | } |
| 256 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…