Browse Source

Revert "Revert "fix: ensure MAX_SAFE_INTEGER exists""

This reverts commit 79d2daa0cc.
master
Chris Dickinson 2 years ago
parent
commit
323cb66c38
  1. 2
      encode.js

2
encode.js

@ -6,7 +6,7 @@ var MSB = 0x80
, INT = Math.pow(2, 31)
function encode(num, out, offset) {
if (num > Number.MAX_SAFE_INTEGER) {
if (Number.MAX_SAFE_INTEGER && num > Number.MAX_SAFE_INTEGER) {
encode.bytes = 0
throw new RangeError('Could not encode varint')
}

Loading…
Cancel
Save