Reproduciable example:
import { parseHTML } from 'linkedom';
const window = parseHTML('<!DOCTYPE html><html><head></head><body></body></html>');
// These are OK:
// window.document.body.innerHTML = '1';
// window.document.body.innerText = '1';
// These are not:
window.document.body.innerHTML = 1;
window.document.body.innerText = 1;
The behavior tested on the browser seems to be consistent with
set innerHTML(value) {
internalSetInnerHTMLWithString(this, value === null ? '' : String(value));
}