[Webkit-unassigned] [Bug 42613] New: WebScriptObject Should Allow Safely Checking For Key Existence

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 19 21:06:52 PDT 2010


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

           Summary: WebScriptObject Should Allow Safely Checking For Key
                    Existence
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: Mac OS X 10.5
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKit API
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: joepeck at webkit.org


This would be equivalent to JavaScript's `in` syntax.

For instance, the following cannot be done easily with WebScriptObject:

    var obj = {};
    var exists = ("key" in obj);

Methods include try/catch blocks with valueForKey, or overriding
undefinedKeySupport to return a value (not quite perfect):

    @implementation WebScriptObject(Info8_pCMUndefinedKeySupport)
    - (id)valueForUndefinedKey:(NSString *)key
    {
        NSLog(@"called valueForUndefinedKey: %@", key);
        return nil;
    }
    @end

Neither are ideal.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list