Last Comment Bug 764277 - New DOM bindings codegen doesn't register classes with constructors
: New DOM bindings codegen doesn't register classes with constructors
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla16
Assigned To: Peter Van der Beken [:peterv]
Depends on:
Blocks: 764234
  Show dependency treegraph
Reported: 2012-06-12 23:25 PDT by Johnny Stenback (:jst,
Modified: 2012-06-20 02:23 PDT (History)
6 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Hacky fix. (1.41 KB, patch)
2012-06-12 23:25 PDT, Johnny Stenback (:jst,
no flags Details | Diff | Splinter Review
v1 (15.46 KB, patch)
2012-06-14 07:50 PDT, Peter Van der Beken [:peterv]
no flags Details | Diff | Splinter Review
v1 (15.45 KB, patch)
2012-06-14 08:18 PDT, Peter Van der Beken [:peterv]
jst: review+
Details | Diff | Splinter Review

Description Johnny Stenback (:jst, 2012-06-12 23:25:27 PDT
Created attachment 632566 [details] [diff] [review]
Hacky fix.

When we do codegen for a webidl interface that has a constructor we don't generate code that actually registers that interface as a global constructor with the DOM code, which means the codegen alone doesn't make a constructable interface constructable in JS. This stuff happens to work for existing classes, where we already have old bindings that trigger the registration of the constructors, but for new types, we need more.

I hacked up a patch that makes this work, but it's not right, nor pretty. But it's enough to get Bonnie unblocked in bug 764234. The attached patch ends up working, but it registers classes that don't have constructors as well as ones that do, so someone who understands the WebIDL parser, dom binding config guts, and the code generator better than I do (hi peter :) should write an appropriate fix here.
Comment 1 Boris Zbarsky [:bz] 2012-06-12 23:37:35 PDT
Note bug 764234 comment 1.
Comment 2 Boris Zbarsky [:bz] 2012-06-12 23:38:07 PDT
And in particular, we _do_ want to register things that don't have constructors, as long as they have interface objects.
Comment 3 Johnny Stenback (:jst, 2012-06-13 09:24:05 PDT
Cc:ing William too in case this matters for his work on notifications...
Comment 4 Peter Van der Beken [:peterv] 2012-06-14 07:50:15 PDT
Created attachment 633136 [details] [diff] [review]

Just nullchecking on hash-insertion means we'll have to check for the uninitialized type in DOMCI, which seems wrong. This adds an overwritable eTypeNewDOMBinding type. Still needs testing.
Comment 5 Peter Van der Beken [:peterv] 2012-06-14 08:18:56 PDT
Created attachment 633141 [details] [diff] [review]
Comment 6 Peter Van der Beken [:peterv] 2012-06-19 06:45:51 PDT
Comment 7 Ed Morley [:emorley] 2012-06-20 02:23:42 PDT

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