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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 19 21:13:02 PDT 2010


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


Joseph Pecoraro <joepeck at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #62031|                            |review?
               Flag|                            |




--- Comment #1 from Joseph Pecoraro <joepeck at webkit.org>  2010-07-19 21:13:02 PST ---
Created an attachment (id=62031)
 --> (https://bugs.webkit.org/attachment.cgi?id=62031)
[PATCH] Adds `hasWebScriptKey`

Wise words of Geoff Garen:

> I agree that throwing an exception from valueForUndefinedKey: is
> fragile. It's unfortunate that NSObject chose an exception as the
> default implementation. Perhaps WebScriptObject should have overridden
> this behavior from the beginning. On the other hand, maybe overriding
> the default would have been confusing to authors used to the default.
> [...]
> 
> I know that Safari, at least, depends on the exception throwing
> behavior to detect properties that are not present. We could always
> change Safari, but I'm worried that other clients may have the same
> dependency. So I don't think we should change valueForUndefinedKey:.
> 
> Joe: The hasKey: addition sounds fine, with one modification:
> WebScriptObject is trying to conform to the key-value coding protocol,
> and it takes care to call out its own additions to the protocol
> using a special prefix. So, to match "removeWebScriptKey:", which
> is an addition to key-value coding, I would suggest "hasWebScriptKey:".

That is the approach I took here.

-- 
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