46
46
#if defined(NODE_HAVE_I18N_SUPPORT)
47
47
48
48
#include " base_object-inl.h"
49
+ #include " crypto/crypto_util.h"
49
50
#include " node.h"
50
51
#include " node_buffer.h"
51
52
#include " node_errors.h"
@@ -440,7 +441,7 @@ void ConverterObject::Decode(const FunctionCallbackInfo<Value>& args) {
440
441
441
442
ConverterObject* converter;
442
443
ASSIGN_OR_RETURN_UNWRAP (&converter, args[0 ].As <Object>());
443
- ArrayBufferViewContents <char > input (args[1 ]);
444
+ crypto::ArrayBufferOrViewContents <char > input (args[1 ]);
444
445
int flags = args[2 ]->Uint32Value (env->context ()).ToChecked ();
445
446
446
447
UErrorCode status = U_ZERO_ERROR;
@@ -453,12 +454,10 @@ void ConverterObject::Decode(const FunctionCallbackInfo<Value>& args) {
453
454
// characters times the min char size, multiplied by 2 as unicode may
454
455
// take up to 2 UChars to encode a character
455
456
size_t limit = 2 * converter->min_char_size () *
456
- (!flush ?
457
- input.length () :
458
- std::max (
459
- input.length (),
460
- static_cast <size_t >(
461
- ucnv_toUCountPending (converter->conv (), &status))));
457
+ (!flush ? input.size ()
458
+ : std::max (input.size (),
459
+ static_cast <size_t >(ucnv_toUCountPending (
460
+ converter->conv (), &status))));
462
461
status = U_ZERO_ERROR;
463
462
464
463
if (limit > 0 )
@@ -473,7 +472,7 @@ void ConverterObject::Decode(const FunctionCallbackInfo<Value>& args) {
473
472
});
474
473
475
474
const char * source = input.data ();
476
- size_t source_length = input.length ();
475
+ size_t source_length = input.size ();
477
476
478
477
UChar* target = *result;
479
478
ucnv_toUnicode (converter->conv (),
0 commit comments