chore(): webpack does not some local variables (#19458)

fixes #19442
This commit is contained in:
Manu MA
2019-09-27 14:58:10 +02:00
committed by GitHub
parent b4d92c6241
commit 20ffc95ff1

View File

@ -52,11 +52,11 @@ export const sanitizeDOMString = (untrustedString: string | undefined): string |
*/ */
// IE does not support .children on document fragments, only .childNodes // IE does not support .children on document fragments, only .childNodes
const documentFragmentChildren = getElementChildren(documentFragment); const dfChildren = getElementChildren(documentFragment);
/* tslint:disable-next-line */ /* tslint:disable-next-line */
for (let childIndex = 0; childIndex < documentFragmentChildren.length; childIndex++) { for (let childIndex = 0; childIndex < dfChildren.length; childIndex++) {
sanitizeElement(documentFragmentChildren[childIndex]); sanitizeElement(dfChildren[childIndex]);
} }
// Append document fragment to div // Append document fragment to div
@ -118,8 +118,8 @@ const sanitizeElement = (element: any) => {
* IE doesn't always support .children * IE doesn't always support .children
* so we revert to .childNodes instead * so we revert to .childNodes instead
*/ */
const getElementChildren = (element: any) => { const getElementChildren = (el: any) => {
return (element.children != null) ? element.children : element.childNodes; return (el.children != null) ? el.children : el.childNodes;
}; };
const allowedAttributes = ['class', 'id', 'href', 'src', 'name', 'slot']; const allowedAttributes = ['class', 'id', 'href', 'src', 'name', 'slot'];