Closed Bug 568731 Opened 10 years ago Closed 10 years ago
TM: rename JSNoop
Proxy Handler to JSWrapper and move it into jswrapper .[h|cpp]
This file will hold our new membranes and wrapper code.
Assignee: general → gal
Attachment #447899 - Flags: review?(mozilla+ben) → review?(cdleary)
Comment on attachment 447899 [details] [diff] [review] patch The singleton wrapper object is a static member of the |JSWrapper| class, so calling |JSWrapper::wrap| will only ever resolve to |JSWrapper::construct| when |singleton.construct| is called in that function -- I don't think that's what we want. The interface that was in there before, |JSWrapper<typename T extends JSWrapper>::wrap| seems to make the most sense, so you can grab |T::singleton| like it was doing. You can expose this kind of thing across C API boundaries by making a helper function per wrapper class that does something like |NopWrap = JSWrapper<JSWrapper>::wrap|. The interface for JSNoopProxyHandler is still in there, should rip that out too. The naming is getting confusing -- in ::wrap you have |JSWrapper *handler, JSObject *wrapper|. I get that the wrapper is the JS-land wrapper object, but still makes me double take. :-) Classes in namespace js don't need a JS prefix, but that's probably for another bug.
Attachment #447899 - Flags: review?(cdleary)
I will leave a more complex solution to wrap() to a follow-up patch that actually specializes wrappers.
Attachment #448302 - Flags: review?(cdleary) → review+
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.