Skip to content

Commit a95c016

Browse files
committed
merging changes from electron-edge-js
1 parent 7d4f193 commit a95c016

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/mono/clrfunc.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,12 @@ v8::Local<v8::Value> ClrFunc::MarshalCLRExceptionToV8(MonoException* exception)
375375

376376
// Construct an error that is just used for the prototype - not verify efficient
377377
// but 'typeof Error' should work in JavaScript
378+
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION >= 14)
379+
result->SetPrototypeV2(Nan::GetCurrentContext(), v8::Exception::Error(message));
380+
#else
378381
result->SetPrototype(Nan::GetCurrentContext(), v8::Exception::Error(message));
382+
#endif
383+
379384
result->Set(Nan::GetCurrentContext(), Nan::New<v8::String>("message").ToLocalChecked(), message);
380385

381386
// Recording the actual type - 'name' seems to be the common used property

0 commit comments

Comments
 (0)