Commit 9c321a9d authored by Dan Elphick's avatar Dan Elphick Committed by Commit Bot

[cleanup] Fix use of deprecated GetFunction method

Use MaybeLocal version of GetFunction in GinJavaBridgeObject as original
function is deprecated. Since the original code seems to react to other
failures by returning an empty Local<>, I've used the same pattern
rather than ToLocalChecked.

Bug: v8:7295, v8:8238
Change-Id: I634b4d7ec51c4874f9628f05fbf5106f10c0990c
Reviewed-on: https://chromium-review.googlesource.com/c/1348045Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610868}
parent e1ca1f9a
...@@ -89,10 +89,13 @@ v8::Local<v8::Value> GinJavaBridgeObject::GetNamedProperty( ...@@ -89,10 +89,13 @@ v8::Local<v8::Value> GinJavaBridgeObject::GetNamedProperty(
} }
known_methods_[property] = dispatcher_->HasJavaMethod(object_id_, property); known_methods_[property] = dispatcher_->HasJavaMethod(object_id_, property);
} }
if (known_methods_[property]) if (known_methods_[property]) {
return GetFunctionTemplate(isolate, property)->GetFunction(); return GetFunctionTemplate(isolate, property)
else ->GetFunction(isolate->GetCurrentContext())
.FromMaybe(v8::Local<v8::Value>());
} else {
return v8::Local<v8::Value>(); return v8::Local<v8::Value>();
}
} }
std::vector<std::string> GinJavaBridgeObject::EnumerateNamedProperties( std::vector<std::string> GinJavaBridgeObject::EnumerateNamedProperties(
......
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