(id)
| 101 | } |
| 102 | |
| 103 | function requireForUserSnapshot(id) { |
| 104 | const normalizedId = normalizeRequirableId(id); |
| 105 | if (!normalizedId) { |
| 106 | // eslint-disable-next-line no-restricted-syntax |
| 107 | const err = new Error( |
| 108 | `Cannot find module '${id}'. `, |
| 109 | ); |
| 110 | err.code = 'MODULE_NOT_FOUND'; |
| 111 | throw err; |
| 112 | } |
| 113 | if (isBuildingSnapshot() && !supportedInUserSnapshot(normalizedId)) { |
| 114 | if (!warnedModules.has(normalizedId)) { |
| 115 | // Emit the warning synchronously in case we don't get to process |
| 116 | // the tick and print it before the unsupported built-in causes a |
| 117 | // crash. |
| 118 | emitWarningSync( |
| 119 | `It's not yet fully verified whether built-in module "${id}" ` + |
| 120 | 'works in user snapshot builder scripts.\n' + |
| 121 | 'It may still work in some cases, but in other cases certain ' + |
| 122 | 'run-time states may be out-of-sync after snapshot deserialization.\n' + |
| 123 | 'To request support for the module, use the Node.js issue tracker: ' + |
| 124 | 'https://github.com/nodejs/node/issues'); |
| 125 | warnedModules.add(normalizedId); |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | return require(normalizedId); |
| 130 | } |
| 131 | |
| 132 | |
| 133 | function main() { |
nothing calls this directly
no test coverage detected