| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 4782818 commit 7166986
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -775,14 +775,9 @@ inline void Environment::ThrowRangeError(const char* errmsg) { | |||
| 775 | 775 | ThrowError(v8::Exception::RangeError, errmsg); | |
| 776 | 776 | } | |
| 777 | 777 | ||
| 778 | - inline void Environment::ThrowError(V8ExceptionConstructorOld fun, | ||
| 779 | - const char* errmsg) { | ||
| 780 | - v8::HandleScope handle_scope(isolate()); | ||
| 781 | - isolate()->ThrowException(fun(OneByteString(isolate(), errmsg))); | ||
| 782 | - } | ||
| 783 | - | ||
| 784 | - inline void Environment::ThrowError(V8ExceptionConstructorNew fun, | ||
| 785 | - const char* errmsg) { | ||
| 778 | + inline void Environment::ThrowError( | ||
| 779 | + v8::Local<v8::Value> (*fun)(v8::Local<v8::String>, v8::Local<v8::Value>), | ||
| 780 | + const char* errmsg) { | ||
| 786 | 781 | v8::HandleScope handle_scope(isolate()); | |
| 787 | 782 | isolate()->ThrowException(fun(OneByteString(isolate(), errmsg), {})); | |
| 788 | 783 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1029,14 +1029,9 @@ class Environment : public MemoryRetainer { | |||
| 1029 | 1029 | }; | |
| 1030 | 1030 | ||
| 1031 | 1031 | private: | |
| 1032 | - // V8 has changed the constructor of exceptions, support both APIs before Node | ||
| 1033 | - // updates to V8 12.1. | ||
| 1034 | - using V8ExceptionConstructorOld = | ||
| 1035 | - v8::Local<v8::Value> (*)(v8::Local<v8::String>); | ||
| 1036 | - using V8ExceptionConstructorNew = | ||
| 1037 | - v8::Local<v8::Value> (*)(v8::Local<v8::String>, v8::Local<v8::Value>); | ||
| 1038 | - inline void ThrowError(V8ExceptionConstructorOld fun, const char* errmsg); | ||
| 1039 | - inline void ThrowError(V8ExceptionConstructorNew fun, const char* errmsg); | ||
| 1032 | + inline void ThrowError(v8::Local<v8::Value> (*fun)(v8::Local<v8::String>, | ||
| 1033 | + v8::Local<v8::Value>), | ||
| 1034 | + const char* errmsg); | ||
| 1040 | 1035 | void TrackContext(v8::Local<v8::Context> context); | |
| 1041 | 1036 | void UntrackContext(v8::Local<v8::Context> context); | |
| 1042 | 1037 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments