Re: How to specify an object that can be mutable or immutable

On Thu, 26 Sep 2013 14:44:34 +0200, Domenic Denicola  
<domenic@domenicdenicola.com> wrote:

> Right. More worryingly, what would
>
> Object.getOwnPropertyDescriptor(MutableRect.prototype,  
> "left").set.call(immutableRectInstance, 5)
>
> do?

I'm not sure what the specs say about that, but in Gecko this:

<!DOCTYPE html>
<ol><li id=x>x
<script>Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,  
'value').set.call(x, 2)</script>

throws a TypeError. AFAICT DOMRect/DOMRectImmutable (without inheritance)  
would behave the same.

-- 
Simon Pieters
Opera Software

Received on Thursday, 26 September 2013 13:13:01 UTC