From 4ba897750d5ecd89e24d2cc4935064a985fcc9c7 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 3af5446427f349..3e4bdbb1128196 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -4352,7 +4352,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);