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

annevk commented on this pull request.



> @@ -12625,6 +12626,10 @@ internal method as follows.
     applied:
 
     1.  If <a abstract-op>Type</a>(|P|) is not String, then return <emu-val>false</emu-val>.
+    1.  If |P| is "<code>-0</code>", then return <emu-val>false</emu-val>.
+
+        Note: <a abstract-op>CanonicalNumericIndexString</a> allows "<code>-0</code>" as a special
+        case, even though it is not an [=integer index=] or by extension an [=array index=].

If this indeed matches implementations, wouldn't it be cleaner to return false if index is -0 after the following step?

-- 
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-92830874

Received on Wednesday, 31 January 2018 07:56:06 UTC