[Webkit-unassigned] [Bug 123044] EventInit dictionaries don't respect default values

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Oct 19 11:45:19 PDT 2013


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





--- Comment #3 from Sam Weinig <sam at webkit.org>  2013-10-19 11:44:04 PST ---
(In reply to comment #2)
> Indeed, I was confused about when tryGetProperty returns false.
> 
> What does tryGetProperty do for missing string values? KeyboardEvent.key defaults to "", will we get that or  "undefined"? This is currently not observable I think, because we don't expose the key property on KeyboardEvent. But it sounds like a dormant issue in CodeGeneratorJS.pm if so.

I am having a bit of a hard time parsing your question, a JS code example of what you are worried about would help.  But I will try to answer anyway.

If you have a JS object like { location: 0, ctrlKey: true },  and KeyboardEvent had a property called key, JSDictionary would not change the value of the key property.  The chain of calls is:

JSEvent::fillKeyboardEventInit -> JSDictionary::tryGetProperty() -> JSDictionary::tryGetPropertyAndResult() -> JSDictionary::tryGetProperty() [This is a different one than the first one, one of them should be renamed. For now, lets call this actuallyTryGetProperty().]

In actuallyTryGetProperty (see line 64 of JSDictionary.cpp) is first check if there is a property called "key" (via getPropertySlot) and if there is no slot, it returns NoPropertyFound.  

Then, in tryGetPropertyAndResult(), if the result of actuallyTryGetProperty was NoPropertyFound, it does nothing.

So I don't think there is a latent bug 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