Re: [heycam/webidl] Refactor integer conversion in ES bindings. (#235)

tobie commented on this pull request.



> +    1.  Let |r| be [=!=][=isFinite=](|v|).
+    1.  If |r| is <emu-val>false</emu-val>,
+        then <a lt="es throw">throw a <emu-val>TypeError</emu-val></a>.
+</div>
+
+<div algorithm>
+
+    <dfn lt="IntegerPart" abstract-op>IntegerPart(|n|)</dfn>:
+
+    1.  Let |r| be [=floor=]([=abs=](|n|))
+    1.  If |n| &lt; 0, then return -1 * |r|.
+    1.  Otherwise return |r|.
+</div>
+
+<div algorithm>
+    <dfn lt="ConvertToInt" abstract-op>ConvertToInt(|V|, |bitLength|, |type|)</dfn>:

Oh wow, that's *actually* what it's called: https://en.wikipedia.org/wiki/Signedness

-- 
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/235

Received on Friday, 11 November 2016 19:52:47 UTC