I have a .js file linked to a .htm file and the only code within the .js file is the line:
Object.setPrototypeOf(Object.prototype,{x:616});
On loading the .htm page the "chrome console" displays the error:
Uncaught TypeError: Immutable prototype object '#<Object>' cannot have their prototype set
I've never seen this error before and can't find anything for it here or online.
I assumed that the object had been sealed/frozen, so ran the tests:
console.warn('sealed ⇒',Object.isSealed(Object.prototype)); // false
console.warn('frozen ⇒',Object.isFrozen(Object.prototype)); // false
console.warn('extensible ⇒',Object.isExtensible(Object.prototype)); // true
But this shed no light on the problem and as such has left me stumped. This is the first ever time that this has happened when setting the prototype of Object.prototype
and has me wondering if my Chrome browser has auto-updated with new features or something?