@@ -567,16 +567,17 @@ Value MongoCrypt::MakeExplicitEncryptionContext(const CallbackInfo& info) {
567
567
}
568
568
569
569
bool expression_mode = options.Get (" expressionMode" ).ToBoolean ();
570
- auto context_init_function = expression_mode ? mongocrypt_ctx_explicit_encrypt_expression_init
571
- : mongocrypt_ctx_explicit_encrypt_init;
570
+ ExplicitEncryptionContextInitFunction context_init_function =
571
+ expression_mode ? mongocrypt_ctx_explicit_encrypt_expression_init
572
+ : mongocrypt_ctx_explicit_encrypt_init;
572
573
573
574
return MakeExplicitEncryptionContextInternal (context_init_function, valueBuffer, options);
574
575
}
575
576
576
- Value MongoCrypt::MakeExplicitEncryptionContextInternal (bool (*init_fn)( mongocrypt_ctx_t *,
577
- mongocrypt_binary_t *) ,
578
- const Uint8Array& valueBuffer,
579
- const Object& options) {
577
+ Value MongoCrypt::MakeExplicitEncryptionContextInternal (
578
+ ExplicitEncryptionContextInitFunction context_init_function ,
579
+ const Uint8Array& valueBuffer,
580
+ const Object& options) {
580
581
std::unique_ptr<mongocrypt_ctx_t , MongoCryptContextDeleter> context (
581
582
mongocrypt_ctx_new (_mongo_crypt.get ()));
582
583
@@ -642,7 +643,7 @@ Value MongoCrypt::MakeExplicitEncryptionContextInternal(bool (*init_fn)(mongocry
642
643
std::unique_ptr<mongocrypt_binary_t , MongoCryptBinaryDeleter> binaryValue (
643
644
Uint8ArrayToBinary (valueBuffer));
644
645
645
- const bool status = init_fn (context.get (), binaryValue.get ());
646
+ const bool status = context_init_function (context.get (), binaryValue.get ());
646
647
647
648
if (!status) {
648
649
throw TypeError::New (Env (), errorStringFromStatus (context.get ()));
0 commit comments