Dead code in js::FunctionToString

RESOLVED INVALID

Status

()

Core
JavaScript Engine
RESOLVED INVALID
8 months ago
8 months ago

People

(Reporter: efaust, Assigned: efaust)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

8 months ago
Created attachment 8844654 [details] [diff] [review]
Remove dead code from js::FunctionToString

hasSource is the same as the else if, making the elseif stone dead.
Attachment #8844654 - Flags: review?(sphink)
Comment on attachment 8844654 [details] [diff] [review]
Remove dead code from js::FunctionToString

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

Now the only question is if [native code] looks better, or [sourceless code]. Personally, I think they both kinda suck.

But never mind me.
Attachment #8844654 - Flags: review?(sphink) → review+

Comment 2

8 months ago
Pushed by efaustbmo@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/efec0bd16f22
Remove dead code from js::FunctionToString. (r=sfink)
Backed out in https://hg.mozilla.org/integration/mozilla-inbound/rev/54f868ca2c74 - js/xpconnect/tests/chrome/test_discardSystemSource.xul doesn't seem to think it's dead, since https://treeherder.mozilla.org/logviewer.html#?job_id=82303315&repo=mozilla-inbound
Oh, we're dumb.  |haveSource| can be overwritten between its initialization and the point of this removed code, necessitating the double-check.  Whee.

https://hg.mozilla.org/integration/mozilla-inbound/file/efec0bd16f22/js/src/jsfun.cpp#l1016
Status: NEW → RESOLVED
Last Resolved: 8 months ago
Resolution: --- → INVALID
Gah! Sorry, totally should have noticed that. It's almost like the original author knew what he was doing...
efaust ran it by me over IRL before filing the bug, so that makes 3 (count 'em) engineers who sometimes claim to know what they're doing who looked at this and thought it was perfectly cromulent.  AREN'T WE AWESOME.  :-D
You need to log in before you can comment on or make changes to this bug.