diff --git a/lib/buffer.js b/lib/buffer.js index c9f45d333886d3..7cce07ddc5d410 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -99,6 +99,8 @@ const { inspect: utilInspect, } = require('internal/util/inspect'); +const assert = require('internal/assert'); + const { codes: { ERR_BUFFER_OUT_OF_BOUNDS, @@ -1302,9 +1304,9 @@ function atob(input) { throw lazyDOMException( 'The string to be decoded is not correctly encoded.', 'InvalidCharacterError'); - case -3: // Possible overflow - // TODO(@anonrig): Throw correct error in here. - throw lazyDOMException('The input causes overflow.', 'InvalidCharacterError'); + case -3: + assert.fail('Unrecognized simdutf error'); + break; default: return result; }