* Get or create an entry in the CJS module cache for the given filename. * @param {string} filename CJS module filename * @param {CJSModule} parent The parent CJS module * @returns {CJSModule} the cached CJS module entry
(filename, parent)
| 396 | * @returns {CJSModule} the cached CJS module entry |
| 397 | */ |
| 398 | function cjsEmplaceModuleCacheEntry(filename, parent) { |
| 399 | // TODO: Do we want to keep hitting the user mutable CJS loader here? |
| 400 | let cjsMod = CJSModule._cache[filename]; |
| 401 | if (cjsMod) { |
| 402 | return cjsMod; |
| 403 | } |
| 404 | |
| 405 | cjsMod = new CJSModule(filename, parent); |
| 406 | cjsMod.filename = filename; |
| 407 | cjsMod.paths = CJSModule._nodeModulePaths(cjsMod.path); |
| 408 | cjsMod[kIsCachedByESMLoader] = true; |
| 409 | CJSModule._cache[filename] = cjsMod; |
| 410 | |
| 411 | return cjsMod; |
| 412 | } |
| 413 | |
| 414 | /** |
| 415 | * Pre-parses a CommonJS module's exports and re-exports. |
no outgoing calls
no test coverage detected
searching dependent graphs…