Beginning on October 25th, 2016, Persona will no longer be an option for authentication on BMO. For more details see Persona Deprecated.
Last Comment Bug 745361 - Handle conversion rules totally break static typing
: Handle conversion rules totally break static typing
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla14
Assigned To: Brian Hackett (:bhackett)
: Jason Orendorff [:jorendorff]
Depends on:
  Show dependency treegraph
Reported: 2012-04-13 15:20 PDT by Luke Wagner [:luke]
Modified: 2012-04-16 18:59 PDT (History)
4 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

patch (642 bytes, patch)
2012-04-14 07:32 PDT, Brian Hackett (:bhackett)
luke: review+
Details | Diff | Splinter Review

Description Luke Wagner [:luke] 2012-04-13 15:20:53 PDT
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?
Comment 1 Brian Hackett (:bhackett) 2012-04-14 07:32:07 PDT
Created attachment 615047 [details] [diff] [review]

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.
Comment 2 Luke Wagner [:luke] 2012-04-15 21:08:29 PDT
Comment on attachment 615047 [details] [diff] [review]

Ahh, I didn't see testAssign.  Cool.
Comment 3 Brian Hackett (:bhackett) 2012-04-15 21:36:43 PDT
Comment 4 :Ehsan Akhgari (Away Oct 25 - Nov 9) 2012-04-16 08:35:03 PDT

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