| 29 | // WinJS/Core depends on ./Core/_Base |
| 30 | // should return WinJS/Core/_Base |
| 31 | function normalize(id, dependencies) { |
| 32 | id = id || ""; |
| 33 | var parent = id.split('/'); |
| 34 | parent.pop(); |
| 35 | return dependencies.map(function (dep) { |
| 36 | if (dep[0] === '.') { |
| 37 | var parts = dep.split('/'); |
| 38 | var current = parent.slice(0); |
| 39 | parts.forEach(function (part) { |
| 40 | if (part === '..') { |
| 41 | current.pop(); |
| 42 | } else if (part !== '.') { |
| 43 | current.push(part); |
| 44 | } |
| 45 | }); |
| 46 | return current.join('/'); |
| 47 | } else { |
| 48 | return dep; |
| 49 | } |
| 50 | }); |
| 51 | } |
| 52 | |
| 53 | function resolve(dependencies, parent, exports) { |
| 54 | return dependencies.map(function (depName) { |