Closed Bug 1210295 Opened 10 years ago Closed 10 years ago

Simplify TOK_DEFAULT case in Parser::exportDeclaration.

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla44
Tracking Status
firefox44 --- fixed

People

(Reporter: arai, Assigned: arai)

References

Details

Attachments

(1 file)

https://dxr.mozilla.org/mozilla-central/rev/97e537f85183ef31481602ab9e5587a6e7d16b4d/js/src/frontend/Parser.cpp#4967 > ParseNode* binding = nullptr; > switch (tt) { > case TOK_FUNCTION: > kid = functionStmt(YieldIsKeyword, AllowDefaultName); > break; > case TOK_CLASS: > kid = classDefinition(YieldIsKeyword, ClassStatement, AllowDefaultName); > break; > default: > tokenStream.ungetToken(); > RootedPropertyName name(context, context->names().starDefaultStar); > binding = makeInitializedLexicalBinding(name, true, pos()); > if (!binding) > return null(); > kid = assignExpr(InAllowed, YieldIsKeyword); > if (kid) { > if (!MatchOrInsertSemicolonAfterExpression(tokenStream)) > return null(); > } > break; > } > if (!kid) > return null(); It's a little confusing that placing |if (!kid)| after |if (kid)|.
Moved |if (!kid)| to each case.
Assignee: nobody → arai.unmht
Attachment #8668275 - Flags: review?(jwalden+bmo)
Attachment #8668275 - Flags: review?(jwalden+bmo) → review+
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: