Last Comment Bug 764698 - Fix distinguishability checking for dictionaries
: Fix distinguishability checking for dictionaries
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM (show other bugs)
: unspecified
: x86 Mac OS X
: -- normal (vote)
: mozilla16
Assigned To: Boris Zbarsky [:bz]
:
Mentors:
Depends on:
Blocks: ParisBindings 742153
  Show dependency treegraph
 
Reported: 2012-06-13 20:55 PDT by Boris Zbarsky [:bz]
Modified: 2012-06-22 03:47 PDT (History)
2 users (show)
bzbarsky: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Fix isDistinguishableFrom for dictionaries to work right. (13.74 KB, patch)
2012-06-13 21:32 PDT, Boris Zbarsky [:bz]
no flags Details | Diff | Splinter Review
Fix isDistinguishableFrom for dictionaries to work right. (13.66 KB, patch)
2012-06-18 19:52 PDT, Boris Zbarsky [:bz]
peterv: review+
Details | Diff | Splinter Review

Description Boris Zbarsky [:bz] 2012-06-13 20:55:46 PDT
I failed to do this right in bug 742153.
Comment 1 Boris Zbarsky [:bz] 2012-06-13 21:32:28 PDT
Created attachment 633013 [details] [diff] [review]
Fix isDistinguishableFrom for dictionaries to work right.

While writing this, I discovered that isCallback() is false in IDLWrapperType (which makes sense) but that we had consumers checking isCallback() on types and assuming that would catch callback interfaces.  So I added better ways of testing for that and used them throughout.
Comment 2 Boris Zbarsky [:bz] 2012-06-18 19:52:43 PDT
Created attachment 634275 [details] [diff] [review]
Fix isDistinguishableFrom for dictionaries to work right.
Comment 3 Boris Zbarsky [:bz] 2012-06-19 09:14:53 PDT
Comment on attachment 634275 [details] [diff] [review]
Fix isDistinguishableFrom for dictionaries to work right.

Peter, Kyle is apparently swamped again.  Could you take a look?  I mostly want this because it cleans up the callback stuff a lot...  Kyle did already OK the general idea.
Comment 4 Peter Van der Beken [:peterv] 2012-06-20 14:13:02 PDT
Comment on attachment 634275 [details] [diff] [review]
Fix isDistinguishableFrom for dictionaries to work right.

Review of attachment 634275 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/bindings/parser/WebIDL.py
@@ +1267,5 @@
>          if other.isPrimitive() or other.isString() or other.isEnum():
>              return True
> +        if self.isDictionary():
> +            return (other.isNonCallbackInterface() or other.isSequence() or
> +                    other.isArray())

or isDate()?
Comment 5 Boris Zbarsky [:bz] 2012-06-20 15:00:03 PDT
> or isDate()?

Yes, good catch.  That column was off the right edge of my browser viewport.  ;)
Comment 7 Ed Morley [:emorley] 2012-06-22 03:47:08 PDT
https://hg.mozilla.org/mozilla-central/rev/da942dd41b43

Note You need to log in before you can comment on or make changes to this bug.