MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxStripCallbacks

Function fxStripCallbacks

xs/tools/xslStrip.c:223–663  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221}
222
223void 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);

Callers 1

mainFunction · 0.85

Calls 13

fxUseCodesFunction · 0.85
fxUnstripCallbacksFunction · 0.85
fxUnstripCallbackFunction · 0.85
fxIsCodeUsedFunction · 0.85
fxUnuseSymbolFunction · 0.85
fxStripCallbackFunction · 0.85
fxUnuseCodeFunction · 0.85
fxStripNameFunction · 0.85
fxIsLinkerSymbolUsedFunction · 0.85
fxStripObjectFunction · 0.85
fxIsCallbackStrippedFunction · 0.85
fxStripClassFunction · 0.85

Tested by

no test coverage detected