Changeset 86810 in webkit


Ignore:
Timestamp:
May 18, 2011 6:15:52 PM (13 years ago)
Author:
oliver@apple.com
Message:

2011-05-18 Oliver Hunt <oliver@apple.com>

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):
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r86808 r86810  
     12011-05-18  Oliver Hunt  <oliver@apple.com>
     2
     3        Reviewed by Geoffrey Garen.
     4
     5        +[WebScriptObject throwException:] doesn't work when invoked from obj-c field access
     6        https://bugs.webkit.org/show_bug.cgi?id=61100
     7
     8        The objc bindings were written to assume exceptions would
     9        come from obj-c style exceptions, rather than throwException:
     10        This code simply calls the global ObjcInstance mechanism for
     11        transferring the reported exception.
     12
     13        * bridge/objc/objc_instance.h:
     14        * bridge/objc/objc_runtime.mm:
     15        (JSC::Bindings::ObjcField::valueFromInstance):
     16        (JSC::Bindings::ObjcField::setValueToInstance):
     17
    1182011-05-16  Adrienne Walker  <enne@google.com>
    219
  • trunk/Source/WebCore/bridge/objc/objc_instance.h

    r60392 r86810  
    6868
    6969private:
     70    friend class ObjcField;
    7071    static void moveGlobalExceptionToExecState(ExecState*);
    7172
  • trunk/Source/WebCore/bridge/objc/objc_runtime.mm

    r84822 r86810  
    103103        if (id objcValue = [targetObject valueForKey:(NSString *)_name.get()])
    104104            result = convertObjcValueToValue(exec, &objcValue, ObjcObjectType, instance->rootObject());
     105        {
     106            JSLock lock(SilenceAssertionsOnly);
     107            ObjcInstance::moveGlobalExceptionToExecState(exec);
     108        }
    105109    } @catch(NSException* localException) {
    106110        JSLock::lock(SilenceAssertionsOnly);
     
    131135    @try {
    132136        [targetObject setValue:value forKey:(NSString *)_name.get()];
     137        {
     138            JSLock lock(SilenceAssertionsOnly);
     139            ObjcInstance::moveGlobalExceptionToExecState(exec);
     140        }
    133141    } @catch(NSException* localException) {
    134142        JSLock::lock(SilenceAssertionsOnly);
Note: See TracChangeset for help on using the changeset viewer.