mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-22 19:29:17 +00:00
Replace removeChild with remove (#213465)
* Replace removeChild with remove This replaces most uses of `parent.removeChild(child)` with `child.remove()`. The two are almost equivalent. The only difference is that `parent.removeChild(child)` throws if the given node is not a child of the parent, whereas `child.remove()` never throws. There is no noticable performance difference. The only reason to use `removeChild` is to support Internet Explorer, but that’s no longer supported by Monaco editor. * Fix broken CSP hash The script content changed, so the sha256 hash changed too. * Update src/vs/editor/browser/config/charWidthReader.ts Co-authored-by: Logan Ramos <lramos15@gmail.com> --------- Co-authored-by: Logan Ramos <lramos15@gmail.com>
This commit is contained in:
@@ -11,7 +11,7 @@ import { formatStackTrace } from './stackTraceHelper';
|
||||
|
||||
function clearContainer(container: HTMLElement) {
|
||||
while (container.firstChild) {
|
||||
container.removeChild(container.firstChild);
|
||||
container.firstChild.remove();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -378,7 +378,7 @@ function renderStream(outputInfo: OutputWithAppend, outputElement: HTMLElement,
|
||||
contentParent = document.createElement('div');
|
||||
contentParent.appendChild(newContent);
|
||||
while (outputElement.firstChild) {
|
||||
outputElement.removeChild(outputElement.firstChild);
|
||||
outputElement.firstChild.remove();
|
||||
}
|
||||
outputElement.appendChild(contentParent);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user