Skip to content

Commit

Permalink
update deprecated v8 apis (#147)
Browse files Browse the repository at this point in the history
Thanks for the update!
  • Loading branch information
camillobruni authored Aug 10, 2022
1 parent 86411a9 commit 19b2657
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
3 changes: 2 additions & 1 deletion src/inspector_agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ class ChannelImpl final : public v8_inspector::V8Inspector::Channel,
bool prevent_shutdown)
: delegate_(std::move(delegate)), prevent_shutdown_(prevent_shutdown),
retaining_context_(false) {
session_ = inspector->connect(CONTEXT_GROUP_ID, this, StringView());
session_ = inspector->connect(
CONTEXT_GROUP_ID, this, StringView(), V8Inspector::kFullyTrusted);
node_dispatcher_ = std::make_unique<protocol::UberDispatcher>(this);
tracing_agent_ =
std::make_unique<protocol::TracingAgent>(env, main_thread_);
Expand Down
14 changes: 7 additions & 7 deletions src/node_native_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -284,13 +284,13 @@ MaybeLocal<Function> NativeModuleLoader::LookupAndCompile(
has_cache ? "with" : "without");

MaybeLocal<Function> maybe_fun =
ScriptCompiler::CompileFunctionInContext(context,
&script_source,
parameters->size(),
parameters->data(),
0,
nullptr,
options);
ScriptCompiler::CompileFunction(context,
&script_source,
parameters->size(),
parameters->data(),
0,
nullptr,
options);

// This could fail when there are early errors in the native modules,
// e.g. the syntax errors
Expand Down
14 changes: 7 additions & 7 deletions src/node_snapshotable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -487,13 +487,13 @@ void CompileSerializeMain(const FunctionCallbackInfo<Value>& args) {
};
ScriptCompiler::Source script_source(source, origin);
Local<Function> fn;
if (ScriptCompiler::CompileFunctionInContext(context,
&script_source,
parameters.size(),
parameters.data(),
0,
nullptr,
ScriptCompiler::kEagerCompile)
if (ScriptCompiler::CompileFunction(context,
&script_source,
parameters.size(),
parameters.data(),
0,
nullptr,
ScriptCompiler::kEagerCompile)
.ToLocal(&fn)) {
args.GetReturnValue().Set(fn);
}
Expand Down

0 comments on commit 19b2657

Please sign in to comment.