File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -110,6 +110,8 @@ const {
110110 inspect : utilInspect ,
111111} = require ( 'internal/util/inspect' ) ;
112112
113+ const assert = require ( 'internal/assert' ) ;
114+
113115const {
114116 codes : {
115117 ERR_BUFFER_OUT_OF_BOUNDS ,
@@ -1401,9 +1403,9 @@ function atob(input) {
14011403 throw lazyDOMException (
14021404 'The string to be decoded is not correctly encoded.' ,
14031405 'InvalidCharacterError' ) ;
1404- case - 3 : // Possible overflow
1405- // TODO(@anonrig): Throw correct error in here.
1406- throw lazyDOMException ( 'The input causes overflow.' , 'InvalidCharacterError' ) ;
1406+ case - 3 :
1407+ assert . fail ( 'Unrecognized simdutf error' ) ;
1408+ break ;
14071409 default :
14081410 return result ;
14091411 }
Original file line number Diff line number Diff line change @@ -1512,7 +1512,7 @@ static void Btoa(const FunctionCallbackInfo<Value>& args) {
15121512// In case of error, a negative value is returned:
15131513// * -1 indicates a single character remained,
15141514// * -2 indicates an invalid character,
1515- // * -3 indicates a possible overflow (i.e., more than 2 GB output) .
1515+ // * -3 indicates an unrecognized simdutf error .
15161516static void Atob (const FunctionCallbackInfo<Value>& args) {
15171517 CHECK_EQ (args.Length (), 1 );
15181518 Environment* env = Environment::GetCurrent (args);
@@ -1557,7 +1557,7 @@ static void Atob(const FunctionCallbackInfo<Value>& args) {
15571557 return args.GetReturnValue ().Set (value);
15581558 }
15591559
1560- // Default value is: "possible overflow "
1560+ // Default value is: "unrecognized simdutf error "
15611561 int32_t error_code = -3 ;
15621562
15631563 if (result.error == simdutf::error_code::INVALID_BASE64_CHARACTER ) {
You can’t perform that action at this time.
0 commit comments