- From: Boris Zbarsky <notifications@github.com>
- Date: Thu, 12 Mar 2020 13:10:50 -0700
- To: heycam/webidl <webidl@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <heycam/webidl/pull/840/review/373867736@github.com>
bzbarsky commented on this pull request.
> + 1. If |P| is "length", then return the result of
+ [=observable array exotic object/setting the length=] given |handler| and |V|.
+ 1. If |P| [=is an array index=], then return the result of
+ [=observable array exotic object/setting the indexed value=] given |handler|, |P|, and |V|.
+ 1. Return [=?=] |O|.\[[Set]](|P|, |V|, |Receiver|).
+</div>
+
+<h4 id="es-observable-array-abstract-operations">Abstract operations</h4>
+
+<div algorithm>
+ To <dfn for="observable array exotic object" lt="set the length|setting the length">set the length</dfn>
+ of an observable array exotic object given |handler| and |newLen|:
+
+ 1. Set |newLen| to [=?=] [$ToUint32$](|newLen|).
+ 1. Let |numberLen| be [=?=] [$ToNumber$](|newLen|).
+ 1. If |newLen| ≠ |numberLen|, then throw a {{RangeError}} exception.
Right, but when working with IEEE doubles, `-0 == +0` tests true, in general. So the important part is that the `≠` here is a numeric comparison, not an `Object.is()` kind of thing. And in particular, assigning `-0` to length should work fine and set the length to 0.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/pull/840#discussion_r391868353
Received on Thursday, 12 March 2020 20:11:02 UTC