Commit af509b91 authored by Ross McIlroy's avatar Ross McIlroy Committed by Commit Bot

[Cleanup] Avoid using deprecated v8::Function::New.

Moves to MaybeLocal version in api_event_handler.cc. This code should never through
when creating the function, so explicitly converting with ToLocalChecked().

BUG=v8:7290,v8:8238

Change-Id: I542384b457133b37d6279313bcabf874ad690591
Reviewed-on: https://chromium-review.googlesource.com/c/1349218Reviewed-by: default avatarJochen Eisinger <jochen@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610802}
parent 8c04bb9d
...@@ -281,8 +281,10 @@ void APIEventHandler::FireEventInContext( ...@@ -281,8 +281,10 @@ void APIEventHandler::FireEventInContext(
// We don't store this in a template because the Data (event name) is // We don't store this in a template because the Data (event name) is
// different for each instance. Luckily, this is called during dispatching // different for each instance. Luckily, this is called during dispatching
// an event, rather than e.g. at initialization time. // an event, rather than e.g. at initialization time.
v8::Local<v8::Function> dispatch_event = v8::Function::New( v8::Local<v8::Function> dispatch_event =
isolate, &DispatchEvent, gin::StringToSymbol(isolate, event_name)); v8::Function::New(context, &DispatchEvent,
gin::StringToSymbol(isolate, event_name))
.ToLocalChecked();
v8::Local<v8::Value> massager_args[] = {args_array, dispatch_event}; v8::Local<v8::Value> massager_args[] = {args_array, dispatch_event};
JSRunner::Get(context)->RunJSFunction( JSRunner::Get(context)->RunJSFunction(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment