Re: [heycam/webidl] Disallow -0 in algorithm for checking array index (#517)

TimothyGu commented on this pull request.

Otherwise looks good to me.

> @@ -12627,11 +12628,12 @@ internal method as follows.
     1.  If <a abstract-op>Type</a>(|P|) is not String, then return <emu-val>false</emu-val>.
     1.  Let |index| be [=!=] <a abstract-op>CanonicalNumericIndexString</a>(|P|).
     1.  If |index| is <emu-val>undefined</emu-val>, then return <emu-val>false</emu-val>.
-    1.  If |index| is less than 0 or is greater than or equal to 2<sup>32</sup> − 1, then return
-        <emu-val>false</emu-val>.
-
-          Note: 2<sup>32</sup> − 1 is the maximum array length allowed by ECMAScript.
-
+    1.  If <a abstract-op>IsInteger</a>(|index|) is <emu-val>false</emu-val>,
+        then return <emu-val>false</emu-val>.
+    1.  If |index| is -0, then return <emu-val>false</emu-val>.
+    1.  If |index| is smaller than 0, then return <emu-val>false</emu-val>.
+    1.  If |index| is greater than or equal to 2<sup>32</sup> − 1,
+        then return <emu-val>false</emu-val>.

I would use < and ≥, just to make things a bit more obvious. If you prefer English over mathematical symbols, s/smaller than/less than/.

Also I'd like to keep the note:

> Note: 2<sup>32</sup> − 1 is the maximum array length allowed by ECMAScript.

-- 
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/517#pullrequestreview-94815201

Received on Wednesday, 7 February 2018 18:22:54 UTC