2010-03-02 Nate Chapin <japhet@chromium.org>
authorjaphet@chromium.org <japhet@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Mar 2010 19:10:31 +0000 (19:10 +0000)
committerjaphet@chromium.org <japhet@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Mar 2010 19:10:31 +0000 (19:10 +0000)
        Reviewed by Dimitri Glazkov.

        [V8] Fail gracefully if NPN_GetProperty tries to retrieve a property that doesn't exist.

        https://bugs.webkit.org/show_bug.cgi?id=35588

        Required for passing LayoutTests/plugins/netscape-plugin-property-access-exception.html on Chromium.

        * bindings/v8/NPV8Object.cpp:
        (_NPN_GetProperty): If the result is empty, don't try to convert it to an NPVariant and return false.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55417 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/bindings/v8/NPV8Object.cpp

index dce0279..325ba84 100644 (file)
@@ -1,3 +1,16 @@
+2010-03-02  Nate Chapin  <japhet@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [V8] Fail gracefully if NPN_GetProperty tries to retrieve a property that doesn't exist.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35588
+
+        Required for passing LayoutTests/plugins/netscape-plugin-property-access-exception.html on Chromium.
+
+        * bindings/v8/NPV8Object.cpp:
+        (_NPN_GetProperty): If the result is empty, don't try to convert it to an NPVariant and return false.
+
 2010-03-02  Jian Li  <jianli@chromium.org>
 
         Reviewed by Nate Chapin.
index 53ceea1..22c3b83 100644 (file)
@@ -299,6 +299,9 @@ bool _NPN_GetProperty(NPP npp, NPObject* npObject, NPIdentifier propertyName, NP
 
         v8::Handle<v8::Object> obj(object->v8Object);
         v8::Local<v8::Value> v8result = obj->Get(npIdentifierToV8Identifier(propertyName));
+        
+        if (v8result.IsEmpty())
+            return false;
 
         convertV8ObjectToNPVariant(v8result, npObject, result);
         return true;