Closed
Bug 597574
Opened 14 years ago
Closed 14 years ago
GetPropertyNames and friends should not take outparams by reference
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: jimb, Unassigned)
References
Details
(Whiteboard: [fixed-in-tracemonkey])
Attachments
(1 file)
(deleted),
patch
|
brendan
:
review+
|
Details | Diff | Splinter Review |
When a function takes an out-parameter by reference, it makes it harder to see where things are being modified at call sites. SpiderMonkey has a policy of passing outparams by address. GetPropertyNames and the various function templates that implement it do not follow this convention.
The new 'fix' js::ObjectOps member for bug 492849 should not propagate this error.
Reporter | ||
Updated•14 years ago
|
Attachment #476412 -
Flags: review?(brendan)
Comment 1•14 years ago
|
||
Comment on attachment 476412 [details] [diff] [review]
Change GetPropertyNames to take its out-parameter by address, not by non-const reference.
Thanks, for some reason I let this pass, even though I'm the grumpy grandpa of "non-const-refs for out/inout params considered harmful". Gotta stay grumpy!
/be
Attachment #476412 -
Flags: review?(brendan) → review+
Reporter | ||
Comment 2•14 years ago
|
||
Nothing grumpy about it. For what it's worth, that convention is part of the Google C++ style as well. Pretty operator-overloading-based domain-specific languages are perhaps an exception.
Comment 3•14 years ago
|
||
When I first loaded cfront 0.9 off magtape in 1985, it was clear that operators (complex, the canonical example) were the strong motivation for mutable reference parameters.
/be
Reporter | ||
Comment 4•14 years ago
|
||
Reporter | ||
Updated•14 years ago
|
Whiteboard: [fixed-in-tracemonkey]
Comment 5•14 years ago
|
||
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•