Closed Bug 709322 Opened 8 years ago Closed 8 years ago
Make break/continue parse nodes type-safe
Construct them using constructors that are purely a function of their arguments, and make access to the associated label type-safe. This is more code than the current way, but I think it's easier to follow by being more explicit and not relying on implicit state.
Attachment #580553 - Flags: review?(jorendorff)
Comment on attachment 580553 [details] [diff] [review] Patch Splitting BreakStatement and ContinueStatement is farther than I would have gone, but OK. In Parser.cpp, Parser::statement, case TOK_BREAK: >+ BreakStatement *breakStmt = tc->parser->new_<BreakStatement>(label, begin, end); >+ if (!breakStmt) > return NULL; [...] >+ pn = breakStmt; Looks like you could just assign directly to pn. Same thing in case TOK_CONTINUE. Those two cases look awfully similar.
Attachment #580553 - Flags: review?(jorendorff) → review+
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla11
You need to log in before you can comment on or make changes to this bug.