Commit 0feade6a authored by Mythri Alle's avatar Mythri Alle Committed by Commit Bot

Use maybe version of v8::Object::Has, v8::Object::Delete

V8 API will deprecate the non maybe versions of v8::Object::Has
and v8::Object::Delete. Updated extensions/ to use maybe versions.

Bug: v8:7284
Change-Id: I966abdec0226c5999cacd5bf5daf993747179287
Reviewed-on: https://chromium-review.googlesource.com/c/1254208
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596209}
parent 5bcfa81b
......@@ -45,7 +45,7 @@ v8::Local<v8::Object> GetOrCreateObject(const v8::Local<v8::Object>& object,
// API, so it is safe to delete. This is checked before GetOrCreateObject is
// called.
if (object->HasRealNamedCallbackProperty(key)) {
object->Delete(key);
object->Delete(context->v8_context(), key).ToChecked();
} else if (object->HasRealNamedProperty(key)) {
v8::Local<v8::Value> value = object->Get(key);
CHECK(value->IsObject());
......
......@@ -192,7 +192,9 @@ void SetIconNatives::SetIconCommon(
v8::String::NewFromUtf8(args.GetIsolate(), "tabId",
v8::NewStringType::kInternalized)
.ToLocalChecked();
if (details->Has(tabId)) {
bool has_tabid = false;
if (details->Has(context()->v8_context(), tabId).To(&has_tabid) &&
has_tabid) {
dict->Set(tabId, details->Get(tabId));
}
args.GetReturnValue().Set(dict);
......
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