Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(451)

Unified Diff: ppapi/tests/blink_deprecated_test_plugin.cc

Issue 1813823002: Handle the case where the v8 scriptable object has a property defined with value undefined. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ppapi/tests/blink_deprecated_test_plugin.cc
diff --git a/ppapi/tests/blink_deprecated_test_plugin.cc b/ppapi/tests/blink_deprecated_test_plugin.cc
index b11a37df4334e913beba0ef39947a713664de45b..93fc86531ec89ea602b4e97c276a645759372bda 100644
--- a/ppapi/tests/blink_deprecated_test_plugin.cc
+++ b/ppapi/tests/blink_deprecated_test_plugin.cc
@@ -54,6 +54,18 @@ class InstanceSO : public pp::deprecated::ScriptableObject {
return ScriptableObject::Call(method_name, args, exception);
}
+ bool HasProperty(const pp::Var& name, pp::Var* exception) {
+ if (name.AsString() == "testprop")
+ return true;
+ return false;
+ }
+
+ pp::Var GetProperty(const pp::Var& name, pp::Var* exception) {
+ if (!(name.AsString() == "testprop"))
+ *exception = pp::Var("Property does not exist on ScriptableObject");
+ return pp::Var();
+ }
+
private:
using MethodMap =
std::map<std::string,

Powered by Google App Engine
This is Rietveld 408576698