As a security precaution, we have turned on the setting "Require API key authentication for API requests" for everyone. If this has broken something, please contact
Last Comment Bug 765976 - Simplify CompileFunctionBody's control flow
: Simplify CompileFunctionBody's control flow
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla16
Assigned To: Nicholas Nethercote [:njn]
: Jason Orendorff [:jorendorff]
Depends on:
  Show dependency treegraph
Reported: 2012-06-18 16:58 PDT by Nicholas Nethercote [:njn]
Modified: 2012-06-20 02:18 PDT (History)
1 user (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Simplify CompileFunctionBody's control flow (3.94 KB, patch)
2012-06-18 16:58 PDT, Nicholas Nethercote [:njn]
sphink: review+
Details | Diff | Splinter Review

Description User image Nicholas Nethercote [:njn] 2012-06-18 16:58:13 PDT
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).
Comment 1 User image Nicholas Nethercote [:njn] 2012-06-18 16:58:24 PDT
Created attachment 634241 [details] [diff] [review]
Simplify CompileFunctionBody's control flow
Comment 2 User image Nicholas Nethercote [:njn] 2012-06-18 17:00:14 PDT
Hey, |hg bzexport| actually works!  Nice.
Comment 3 User image Nicholas Nethercote [:njn] 2012-06-18 17:03:53 PDT
BTW, I removed the "/* FoldConstants reported the error already. */" comment because AFAICT it's not true -- FoldConstants() doesn't report any errors.
Comment 4 User image Steve Fink [:sfink] [:s:] 2012-06-19 09:35:39 PDT
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??!
Comment 5 User image Nicholas Nethercote [:njn] 2012-06-19 17:31:51 PDT
Comment 6 User image Ed Morley [:emorley] 2012-06-20 02:18:54 PDT

Note You need to log in before you can comment on or make changes to this bug.