- From: Boris Zbarsky <notifications@github.com>
- Date: Tue, 27 Feb 2018 18:11:21 +0000 (UTC)
- To: heycam/webidl <webidl@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Tuesday, 27 February 2018 18:11:49 UTC
Oh, and unlike a lot of overload scenarios, the "overload numeric and bigint" is not completely insane, because if you want to have an API that takes "numbers of arbitrary precision" your options are: 1. Have it just take `bigint`. Callers can pass `BigInt(0)` or `"0"` but not `0`. 2. Have it take `(bigint or some-numeric-type)`. Callers can pass `0` sanely. Option 1 is slightly harder to use as an API, and the reasoning behind `"0"` being OK but `0` not being OK is subtle and likely to make anyone trying to just pass a small numeric constant be annoyed. Option 2 involves an overload of bigint and numeric, and dataloss if you pass a long-enough string and it gets converted to the numeric. -- 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/525#issuecomment-368972552
Received on Tuesday, 27 February 2018 18:11:49 UTC