Browse Source

crypto: don't use transitionary ThrowException

Since the current environment is in scope use ThrowError on that,
instead of having to lookup the Environment again.

Added benefit, lint the source code.

Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
v0.11.15-release
Timothy J Fontaine 10 years ago
committed by Julien Gilli
parent
commit
efe1781f3d
  1. 6
      src/node_crypto.cc

6
src/node_crypto.cc

@ -344,19 +344,19 @@ void SecureContext::Init(const FunctionCallbackInfo<Value>& args) {
#ifndef OPENSSL_NO_SSL3
method = SSLv3_method();
#else
return ThrowException(Exception::Error(String::New("SSLv3 methods disabled")));
return env->ThrowError("SSLv3 methods disabled");
#endif
} else if (strcmp(*sslmethod, "SSLv3_server_method") == 0) {
#ifndef OPENSSL_NO_SSL3
method = SSLv3_server_method();
#else
return ThrowException(Exception::Error(String::New("SSLv3 methods disabled")));
return env->ThrowError("SSLv3 methods disabled");
#endif
} else if (strcmp(*sslmethod, "SSLv3_client_method") == 0) {
#ifndef OPENSSL_NO_SSL3
method = SSLv3_client_method();
#else
return ThrowException(Exception::Error(String::New("SSLv3 methods disabled")));
return env->ThrowError("SSLv3 methods disabled");
#endif
} else if (strcmp(*sslmethod, "SSLv23_method") == 0) {
method = SSLv23_method();

Loading…
Cancel
Save