chore: remove node patches by using the preload feature (#41080)
This commit is contained in:
parent
031d636823
commit
d13a93fb61
21 changed files with 403 additions and 135 deletions
|
@ -5,6 +5,7 @@
|
|||
#include "shell/common/node_util.h"
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "gin/converter.h"
|
||||
#include "shell/common/node_includes.h"
|
||||
|
||||
namespace electron::util {
|
||||
|
@ -31,7 +32,14 @@ v8::MaybeLocal<v8::Value> CompileAndCall(
|
|||
// This will only be caught when something has gone terrible wrong as all
|
||||
// electron scripts are wrapped in a try {} catch {} by webpack
|
||||
if (try_catch.HasCaught()) {
|
||||
LOG(ERROR) << "Failed to CompileAndCall electron script: " << id;
|
||||
std::string msg = "no error message";
|
||||
if (!try_catch.Message().IsEmpty()) {
|
||||
gin::ConvertFromV8(isolate, try_catch.Message()->Get(), &msg);
|
||||
} else if (try_catch.HasTerminated()) {
|
||||
msg = "script execution has been terminated";
|
||||
}
|
||||
LOG(ERROR) << "Failed to CompileAndCall electron script (" << id
|
||||
<< "): " << msg;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue