Closed Bug 1345261 Opened 7 years ago Closed 7 years ago

Dead code in js::FunctionToString

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: efaust, Assigned: efaust)

Details

Attachments

(1 file)

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+
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
Closed: 7 years 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.

Attachment

General

Created:
Updated:
Size: