mirror of
https://github.com/morluto/rea.git
synced 2026-11-16 11:43:20 +00:00
fix(javascript): read a BigInt literal's truthiness from any spelling
Older Babel keeps a BigInt literal's source digits, which may carry a 0x/0o/0b prefix, so a hexadecimal zero read as truthy and a falsy socket host such as 0x0n could drop a valid acquisition. Parse the value with BigInt. Refs #10002 Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
This commit is contained in:
1 parent
98540f24e0
commit
fe80d52c9e
2 files changed
+12
-2
No files matched your search
@@ -78,6 +78,9 @@ it.each([
|
||||
["a negative-zero host", `net.connect({ port: 0, host: -0 })`],
|
||||
["a false host", `net.connect({ port: 0, host: false })`],
|
||||
["a zero BigInt host", `net.connect({ port: 0, host: 0n })`],
|
||||
["a hexadecimal zero BigInt host", `net.connect({ port: 0, host: 0x0n })`],
|
||||
["an octal zero BigInt host", `net.connect({ port: 0, host: 0o0n })`],
|
||||
["a binary zero BigInt host", `net.connect({ port: 0, host: 0b0n })`],
|
||||
["a NaN host", `net.connect({ port: 0, host: NaN })`],
|
||||
["a void host", `net.connect({ port: 0, host: void 0 })`],
|
||||
["a negated host", `net.connect({ port: 0, host: !1 })`],
|
||||
|
||||
Reference in new issue
Block a user