Closed
Bug 770999
Opened 11 years ago
Closed 11 years ago
Convert reference(), value(), raw() on handles and Root<> to get()
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla16
People
(Reporter: billm, Assigned: billm)
Details
Attachments
(1 file)
40.64 KB,
patch
|
bhackett1024
:
review+
|
Details | Diff | Splinter Review |
There are a number of ways to get the value out of a rooted thing explicitly, but they differ depending on whether you have a Handle<> or a Root<>. Also, HeapPtr<> has its own method called get() to do pretty much the same thing. I like get() best because it's short, so I converted the other ones to it. I'm open to changing the name, but I think it's useful for them all to be the same.
Attachment #639175 -
Flags: review?(bhackett1024)
Comment 1•11 years ago
|
||
Comment on attachment 639175 [details] [diff] [review] patch Review of attachment 639175 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/gc/Root.h @@ +212,5 @@ > T operator ->() const { return ptr; } > T * address() { return &ptr; } > const T * address() const { return &ptr; } > + T & get() { return ptr; } > + T get() const { return ptr; } Can the const method here just be removed? It looks weird to have overloads that return either a T or a T&, and Rooted should never be const anyways. (I see a CrossCompartmentKey constructor that does this, but that signature is broken)
Attachment #639175 -
Flags: review?(bhackett1024) → review+
Assignee | ||
Comment 2•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/2ecd5bbb5289
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
You need to log in
before you can comment on or make changes to this bug.
Description
•