diff --git a/src/env-inl.h b/src/env-inl.h index d5124e73e7c4c6..56a96def344194 100644 --- a/src/env-inl.h +++ b/src/env-inl.h @@ -775,14 +775,9 @@ inline void Environment::ThrowRangeError(const char* errmsg) { ThrowError(v8::Exception::RangeError, errmsg); } -inline void Environment::ThrowError(V8ExceptionConstructorOld fun, - const char* errmsg) { - v8::HandleScope handle_scope(isolate()); - isolate()->ThrowException(fun(OneByteString(isolate(), errmsg))); -} - -inline void Environment::ThrowError(V8ExceptionConstructorNew fun, - const char* errmsg) { +inline void Environment::ThrowError( + v8::Local (*fun)(v8::Local, v8::Local), + const char* errmsg) { v8::HandleScope handle_scope(isolate()); isolate()->ThrowException(fun(OneByteString(isolate(), errmsg), {})); } diff --git a/src/env.h b/src/env.h index 9a2ac179101210..a0d6d49f321671 100644 --- a/src/env.h +++ b/src/env.h @@ -1029,14 +1029,9 @@ class Environment : public MemoryRetainer { }; private: - // V8 has changed the constructor of exceptions, support both APIs before Node - // updates to V8 12.1. - using V8ExceptionConstructorOld = - v8::Local (*)(v8::Local); - using V8ExceptionConstructorNew = - v8::Local (*)(v8::Local, v8::Local); - inline void ThrowError(V8ExceptionConstructorOld fun, const char* errmsg); - inline void ThrowError(V8ExceptionConstructorNew fun, const char* errmsg); + inline void ThrowError(v8::Local (*fun)(v8::Local, + v8::Local), + const char* errmsg); void TrackContext(v8::Local context); void UntrackContext(v8::Local context);