Closed Bug 1259580 Opened 8 years ago Closed 8 years ago

Use const and detail namespaces in Proxy interfaces

Categories

(Core :: JavaScript: GC, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla48
Tracking Status
firefox48 --- fixed

People

(Reporter: terrence, Assigned: terrence)

References

Details

Attachments

(1 file)

JSObject::getAllocKindForTenure is marked const, quite reasonably. Proxy currently has no non-const way to get the details field, which requires a ton of scary const_casts. Instead, I figured I'd add const to the Proxy interface where appropriate. Moreover, the exposed implementation bits are guarded with a gently worded comment instead of the more traditional detail namespace. The attached patch attempts to rectify both of these.
Attachment #8734516 - Flags: review?(efaustbmo)
Comment on attachment 8734516 [details] [diff] [review]
constify_proxy_details-v0.diff

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

r=me. Nice.

::: js/public/Proxy.h
@@ +426,5 @@
>  {
>      return GetObjectClass(obj)->isProxy();
>  }
>  
> +namespace detail {

Nice. I was always skeeved out by how much of the guts we showed off.
Attachment #8734516 - Flags: review?(efaustbmo) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/e6b28d1a8a043194ae6c42e2c1d645ba7f475d11
Bug 1259580 - Hide as many Proxy details as possible behind a detail namespace; r=efaust
https://hg.mozilla.org/mozilla-central/rev/e6b28d1a8a04
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: