W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2013

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

From: Simon Pieters <simonp@opera.com>
Date: Thu, 26 Sep 2013 15:12:25 +0200
To: "Domenic Denicola" <domenic@domenicdenicola.com>
Cc: "Dirk Schulze" <dschulze@adobe.com>, "robert@ocallahan.org" <robert@ocallahan.org>, "public-script-coord@w3.org" <public-script-coord@w3.org>
Message-ID: <op.w30saznmidj3kv@simons-macbook-pro.local>
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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:37:50 UTC