Use const and detail namespaces in Proxy interfaces

RESOLVED FIXED in Firefox 48

Status

()

Core
JavaScript: GC
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: terrence, Assigned: terrence)

Tracking

Trunk
mozilla48
Points:
---

Firefox Tracking Flags

(firefox48 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

2 years ago
Created attachment 8734516 [details] [diff] [review]
constify_proxy_details-v0.diff

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 1

2 years ago
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+
(Assignee)

Comment 2

2 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/e6b28d1a8a043194ae6c42e2c1d645ba7f475d11
Bug 1259580 - Hide as many Proxy details as possible behind a detail namespace; r=efaust

Comment 3

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/e6b28d1a8a04
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
status-firefox48: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
You need to log in before you can comment on or make changes to this bug.