Closed
Bug 745361
Opened 13 years ago
Closed 13 years ago
Handle conversion rules totally break static typing
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla14
People
(Reporter: luke, Assigned: bhackett1024)
Details
Attachments
(1 file)
642 bytes,
patch
|
luke
:
review+
|
Details | Diff | Splinter Review |
This type checks but I don't think it should
RootedVarString r(...);
HandleObject h = r;
I think the solution is to remove this constructor and fix other things with explicit (restrict) casts.
template <class T>
template <class U>
Handle<T>::Handle(const RootedVar<U> &);
and the analogous one for Root<U>.
Also, can we move Handle out of jsprvtd.h?
Assignee | ||
Comment 1•13 years ago
|
||
Oops, this constructor was missing a testAssign, which is supposed to only allow handle assignments that follow normal C++ assignment rules for the wrapped type. See the other Handle constructors, which are also templated on a type other than the handle. Requiring casts whenever converting between handles of different but compatible types would be a mess I think, with all the subclassing we do for objects and strings.
Assignee: general → bhackett1024
Attachment #615047 -
Flags: review?(luke)
![]() |
Reporter | |
Comment 2•13 years ago
|
||
Comment on attachment 615047 [details] [diff] [review]
patch
Ahh, I didn't see testAssign. Cool.
Attachment #615047 -
Flags: review?(luke) → review+
Assignee | ||
Comment 3•13 years ago
|
||
Comment 4•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla14
You need to log in
before you can comment on or make changes to this bug.
Description
•