Title: [86810] trunk/Source/WebCore
Revision
86810
Author
[email protected]
Date
2011-05-18 18:15:52 -0700 (Wed, 18 May 2011)

Log Message

2011-05-18  Oliver Hunt  <[email protected]>

        Reviewed by Geoffrey Garen.

        +[WebScriptObject throwException:] doesn't work when invoked from obj-c field access
        https://bugs.webkit.org/show_bug.cgi?id=61100

        The objc bindings were written to assume exceptions would
        come from obj-c style exceptions, rather than throwException:
        This code simply calls the global ObjcInstance mechanism for
        transferring the reported exception.

        * bridge/objc/objc_instance.h:
        * bridge/objc/objc_runtime.mm:
        (JSC::Bindings::ObjcField::valueFromInstance):
        (JSC::Bindings::ObjcField::setValueToInstance):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (86809 => 86810)


--- trunk/Source/WebCore/ChangeLog	2011-05-19 00:45:27 UTC (rev 86809)
+++ trunk/Source/WebCore/ChangeLog	2011-05-19 01:15:52 UTC (rev 86810)
@@ -1,3 +1,20 @@
+2011-05-18  Oliver Hunt  <[email protected]>
+
+        Reviewed by Geoffrey Garen.
+
+        +[WebScriptObject throwException:] doesn't work when invoked from obj-c field access
+        https://bugs.webkit.org/show_bug.cgi?id=61100
+
+        The objc bindings were written to assume exceptions would
+        come from obj-c style exceptions, rather than throwException:
+        This code simply calls the global ObjcInstance mechanism for
+        transferring the reported exception.
+
+        * bridge/objc/objc_instance.h:
+        * bridge/objc/objc_runtime.mm:
+        (JSC::Bindings::ObjcField::valueFromInstance):
+        (JSC::Bindings::ObjcField::setValueToInstance):
+
 2011-05-16  Adrienne Walker  <[email protected]>
 
         Reviewed by James Robinson.

Modified: trunk/Source/WebCore/bridge/objc/objc_instance.h (86809 => 86810)


--- trunk/Source/WebCore/bridge/objc/objc_instance.h	2011-05-19 00:45:27 UTC (rev 86809)
+++ trunk/Source/WebCore/bridge/objc/objc_instance.h	2011-05-19 01:15:52 UTC (rev 86810)
@@ -67,6 +67,7 @@
     virtual void virtualEnd();
 
 private:
+    friend class ObjcField;
     static void moveGlobalExceptionToExecState(ExecState*);
 
     ObjcInstance(ObjectStructPtr, PassRefPtr<RootObject>);

Modified: trunk/Source/WebCore/bridge/objc/objc_runtime.mm (86809 => 86810)


--- trunk/Source/WebCore/bridge/objc/objc_runtime.mm	2011-05-19 00:45:27 UTC (rev 86809)
+++ trunk/Source/WebCore/bridge/objc/objc_runtime.mm	2011-05-19 01:15:52 UTC (rev 86810)
@@ -102,6 +102,10 @@
     @try {
         if (id objcValue = [targetObject valueForKey:(NSString *)_name.get()])
             result = convertObjcValueToValue(exec, &objcValue, ObjcObjectType, instance->rootObject());
+        {
+            JSLock lock(SilenceAssertionsOnly);
+            ObjcInstance::moveGlobalExceptionToExecState(exec);
+        }
     } @catch(NSException* localException) {
         JSLock::lock(SilenceAssertionsOnly);
         throwError(exec, [localException reason]);
@@ -130,6 +134,10 @@
 
     @try {
         [targetObject setValue:value forKey:(NSString *)_name.get()];
+        {
+            JSLock lock(SilenceAssertionsOnly);
+            ObjcInstance::moveGlobalExceptionToExecState(exec);
+        }
     } @catch(NSException* localException) {
         JSLock::lock(SilenceAssertionsOnly);
         throwError(exec, [localException reason]);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to