(relativePath, parentModule)
| 235 | } |
| 236 | |
| 237 | function resolveModulePath(relativePath, parentModule) { |
| 238 | if (!relativePath) return; |
| 239 | if (!(parentModule && parentModule.filename)) return; |
| 240 | |
| 241 | if (!nativeModules) nativeModules = process.binding('natives'); |
| 242 | if (nativeModules.hasOwnProperty(relativePath)) return; |
| 243 | if (relativePath[0] === '.') return; |
| 244 | if (isAbsolute(relativePath)) return; |
| 245 | |
| 246 | const folderPath = path.dirname(parentModule.filename); |
| 247 | |
| 248 | const range = |
| 249 | cache.folders[folderPath] && cache.folders[folderPath][relativePath]; |
| 250 | if (!range) { |
| 251 | const builtinPath = cache.builtins[relativePath]; |
| 252 | if (builtinPath) { |
| 253 | return builtinPath; |
| 254 | } else { |
| 255 | return; |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | const candidates = cache.dependencies[relativePath]; |
| 260 | if (candidates == null) return; |
| 261 | |
| 262 | for (let version in candidates) { |
| 263 | const resolvedPath = candidates[version]; |
| 264 | if (Module._cache[resolvedPath] || isCorePath(resolvedPath)) { |
| 265 | if (satisfies(version, range)) return resolvedPath; |
| 266 | } |
| 267 | } |
| 268 | } |
| 269 | |
| 270 | function registerBuiltins(devMode) { |
| 271 | if ( |
no test coverage detected