| 221 | } |
| 222 | |
| 223 | void fxStripCallbacks(txLinker* linker, txMachine* the) |
| 224 | { |
| 225 | txLinkerStrip* linkerStrip; |
| 226 | txLinkerBuilder* linkerBuilder; |
| 227 | txID id; |
| 228 | char buffer[1024]; |
| 229 | |
| 230 | if (linker->stripFlag == XS_STRIP_EXPLICIT_FLAG) { |
| 231 | fxUseCodes(); |
| 232 | id = 0; |
| 233 | while (id < linker->symbolIndex) { |
| 234 | linker->symbolArray[id]->flag = 1; |
| 235 | id++; |
| 236 | } |
| 237 | fxUnstripCallbacks(linker); |
| 238 | } |
| 239 | else { |
| 240 | linkerBuilder = linker->firstBuilder; |
| 241 | while (linkerBuilder) { |
| 242 | txID id = linkerBuilder->host.id; |
| 243 | txLinkerSymbol* symbol = linker->symbolArray[id]; |
| 244 | if (symbol->flag) |
| 245 | fxUnstripCallback(linker, linkerBuilder->host.callback); |
| 246 | linkerBuilder = linkerBuilder->nextBuilder; |
| 247 | } |
| 248 | |
| 249 | if (fxIsCodeUsed(XS_CODE_ARRAY)) |
| 250 | fxUnstripCallback(linker, fx_Array); |
| 251 | |
| 252 | if (fxIsCodeUsed(XS_CODE_ASYNC_FUNCTION)|| fxIsCodeUsed(XS_CODE_ASYNC_GENERATOR_FUNCTION) || fxIsCodeUsed(XS_CODE_IMPORT) || fxIsCodeUsed(XS_CODE_USING_ASYNC)) |
| 253 | fxUnstripCallback(linker, fx_Promise); |
| 254 | |
| 255 | if (fxIsCodeUsed(XS_CODE_ASYNC_GENERATOR_FUNCTION)) |
| 256 | fxUnstripCallback(linker, fx_AsyncIterator_prototype_asyncIterator); |
| 257 | |
| 258 | if (fxIsCodeUsed(XS_CODE_BIGINT_1) || fxIsCodeUsed(XS_CODE_BIGINT_2)) |
| 259 | fxUnstripCallback(linker, fx_BigInt); |
| 260 | |
| 261 | if (fxIsCodeUsed(XS_CODE_REGEXP)) |
| 262 | fxUnstripCallback(linker, fx_RegExp); |
| 263 | |
| 264 | fxUnstripCallback(linker, fx_RangeError); |
| 265 | #if mxExplicitResourceManagement |
| 266 | if (fxIsCodeUsed(XS_CODE_USED_1) || fxIsCodeUsed(XS_CODE_USED_2)) |
| 267 | fxUnstripCallback(linker, fx_SuppressedError); |
| 268 | #endif |
| 269 | fxUnstripCallback(linker, fx_SyntaxError); |
| 270 | } |
| 271 | linkerStrip = linker->firstStrip; |
| 272 | while (linkerStrip) { |
| 273 | txString name = linkerStrip->name; |
| 274 | if (!c_strchr(name, '.')) { |
| 275 | if (!c_strcmp(name, "Atomics")) |
| 276 | fxUnuseSymbol(linker, mxID(_Atomics)); |
| 277 | else if (!c_strcmp(name, "BigInt")) { |
| 278 | fxStripCallback(linker, fx_BigInt); |
| 279 | fxUnuseSymbol(linker, mxID(_BigInt64Array)); |
| 280 | fxStripCallback(linker, fx_BigInt64Array); |
no test coverage detected