From b2b48083a676822e6d2da80909e7458362f3c6e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Sat, 13 Oct 2018 19:23:07 +0200 Subject: [PATCH] crypto: simplify error handling in ECDH::New The type of the argument is being checked within JS which makes the type checking in C++ unnecessary. PR-URL: https://github.com/nodejs/node/pull/23647 Reviewed-By: Colin Ihrig Reviewed-By: Anna Henningsen --- src/node_crypto.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 088483686df0dc..89ec7f7d1447f0 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -4342,7 +4342,7 @@ void ECDH::New(const FunctionCallbackInfo& args) { MarkPopErrorOnReturn mark_pop_error_on_return; // TODO(indutny): Support raw curves? - THROW_AND_RETURN_IF_NOT_STRING(env, args[0], "ECDH curve name"); + CHECK(args[0]->IsString()); node::Utf8Value curve(env->isolate(), args[0]); int nid = OBJ_sn2nid(*curve);