* Compiles a function from the given code string. * @param {string} code - The code string to compile. * @param {string} filename - The filename to use for the compiled function. * @param {number} lineOffset - The line offset to use for the compiled function. * @param {number} columnOffset - The
( code, filename, lineOffset, columnOffset, cachedData, produceCachedData, parsingContext, contextExtensions, params, hostDefinedOptionId, importModuleDynamically)
| 131 | * @throws {ERR_INVALID_ARG_TYPE} If the parsing context is not a valid context object. |
| 132 | */ |
| 133 | function internalCompileFunction( |
| 134 | code, filename, lineOffset, columnOffset, |
| 135 | cachedData, produceCachedData, parsingContext, contextExtensions, |
| 136 | params, hostDefinedOptionId, importModuleDynamically) { |
| 137 | const result = compileFunction( |
| 138 | code, |
| 139 | filename, |
| 140 | lineOffset, |
| 141 | columnOffset, |
| 142 | cachedData, |
| 143 | produceCachedData, |
| 144 | parsingContext, |
| 145 | contextExtensions, |
| 146 | params, |
| 147 | hostDefinedOptionId, |
| 148 | ); |
| 149 | |
| 150 | if (produceCachedData) { |
| 151 | result.function.cachedDataProduced = result.cachedDataProduced; |
| 152 | } |
| 153 | |
| 154 | if (result.cachedData) { |
| 155 | result.function.cachedData = result.cachedData; |
| 156 | } |
| 157 | |
| 158 | if (typeof result.cachedDataRejected === 'boolean') { |
| 159 | result.function.cachedDataRejected = result.cachedDataRejected; |
| 160 | } |
| 161 | |
| 162 | registerImportModuleDynamically(result.function, importModuleDynamically); |
| 163 | |
| 164 | return result; |
| 165 | } |
| 166 | |
| 167 | /** |
| 168 | * Creates a contextify script. |
no test coverage detected
searching dependent graphs…