[Webkit-unassigned] [Bug 42639] Moves various exception code offsets to a central place.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 20 09:02:58 PDT 2010


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





--- Comment #4 from Marcus Bulach <bulach at chromium.org>  2010-07-20 09:02:58 PST ---
(In reply to comment #3)
> (In reply to comment #2)
> > On the other hand, it adds a small burden when setting the exception code, as it now needs to offset it (rather than just use the enum value).
> 
> What I’m concerned about ost is the risk of writing the code wrong and not knowing it's wrong.

yep, that's why I didn't do on all classes at once.. ;)

> 
> It seems that now you could easily forget the offset entirely, or use the wrong offset with the wrong error code. Is there some way we can catch those mistakes at compile time?

yep, forgetting to offset is entirely possible (nit: use the wrong offset is detected at compile time though).

I'm not sure if it's possible to check that the offset is being added at compile time unless we make ExceptionCode generally more opaque, but that would be far too large for probably too little benefit.

one step back: another approach would be to have some attribute like "CheckEnumsWithOffset" in the IDL.
we could still benefit from compile-time check of values, have the offsets centralized, safe type-based range check, but at the expense of keeping the attribute in the IDL files.

let me try a quick draft on how it would look, I'll upload a new patch shortly (unless of course you think the IDL attribute is a bad idea..)

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