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

foolip 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=].

The implementation for this in Chromium:
https://chromium.googlesource.com/v8/v8.git/+/842d424d99060375bf4a8b6fdfd2a0177e4c0477/src/api.cc#4128
https://chromium.googlesource.com/v8/v8.git/+/842d424d99060375bf4a8b6fdfd2a0177e4c0477/src/utils-inl.h#35

So no special handling of "-0" there because the code uses unsigned integers. ES uses ToNumber where negative zero is possible, so whatever this says won't be a close match.

-- 
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#discussion_r164977971

Received on Wednesday, 31 January 2018 08:14:17 UTC