Closed Bug 765976 Opened 12 years ago Closed 12 years ago

Simplify CompileFunctionBody's control flow

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla16

People

(Reporter: n.nethercote, Assigned: n.nethercote)

Details

(Whiteboard: [js:t])

Attachments

(1 file)

CompileFunctionBody()'s second half is oddly keen to avoid return
statements.  By using them, this patch reduces the nesting greatly and makes
the function more readable and more like CompileScript() (and most other
SpiderMonkey code).
Hey, |hg bzexport| actually works!  Nice.
Status: NEW → ASSIGNED
Summary: Simplify CompileFunctionBody's control flow. → Simplify CompileFunctionBody's control flow
Whiteboard: [js:t]
BTW, I removed the "/* FoldConstants reported the error already. */" comment because AFAICT it's not true -- FoldConstants() doesn't report any errors.
Comment on attachment 634241 [details] [diff] [review]
Simplify CompileFunctionBody's control flow

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

Yes, yes, a thousand times yes. The original was... well... WHY??!
Attachment #634241 - Flags: review?(sphink) → review+
https://hg.mozilla.org/mozilla-central/rev/0dba7486e5c7
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: