Closed dmaskasky closed 3 months ago
const cleanupFamiliesSet = new Set<() => void>(); ... currentScope.cleanup = combineVoidFunctions( currentScope.cleanup, ...cleanupFamiliesSet, );
The above code polyfills to
currentScope.cleanup = combineVoidFunctions.apply(void 0, [currentScope.cleanup].concat(cleanupFamiliesSet));
This is not correct and leads to arguments being [() => {}, new Set()]. Whereas expected is [() => {}].
[() => {}, new Set()]
[() => {}]
The solution is to wrap the set with Array.from.
Array.from
const cleanupFamiliesSet = new Set<() => void>(); ... currentScope.cleanup = combineVoidFunctions( currentScope.cleanup, ...Array.from(cleanupFamiliesSet), );
Tests are not catching this issue either.
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
The above code polyfills to
This is not correct and leads to arguments being
[() => {}, new Set()]
. Whereas expected is[() => {}]
.The solution is to wrap the set with
Array.from
.Tests are not catching this issue either.