Commit 0b40913d authored by raymes's avatar raymes Committed by Commit bot

Don't call SetProperty on the plugin unless HasProperty is true

The default implementation of SetProperty in the plugin (inside
ScriptableObject) will throw an exception. This can result in an
unexpected exception in JS when properties are set on the plugin
element. We should only call SetProperty if the plugin has that
property.

BUG=414842
TBR=dmichael@chromium.org

Review URL: https://codereview.chromium.org/640033003

Cr-Commit-Position: refs/heads/master@{#299040}
parent fa1f0b37
......@@ -97,6 +97,16 @@ bool PluginObject::SetNamedProperty(v8::Isolate* isolate,
StringVar::StringToPPVar(identifier));
PepperTryCatchV8 try_catch(instance_, V8VarConverter::kAllowObjectVars,
isolate);
bool has_property =
ppp_class_->HasProperty(ppp_class_data_, identifier_var.get(),
try_catch.exception());
if (try_catch.ThrowException())
return false;
if (!has_property)
return false;
ScopedPPVar var = try_catch.FromV8(value);
if (try_catch.ThrowException())
return false;
......
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