Skip to content

Conditionals tests && Proposal new switch translation#25

Merged
lolleko merged 3 commits intoTypeScriptToLua:masterfrom
lolleko:statement-tests
Feb 16, 2018
Merged

Conditionals tests && Proposal new switch translation#25
lolleko merged 3 commits intoTypeScriptToLua:masterfrom
lolleko:statement-tests

Conversation

@lolleko
Copy link
Copy Markdown
Member

@lolleko lolleko commented Feb 14, 2018

No description provided.


// Assert
Expect(result).toBe(expected);
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a testcase where fallthrough has a visible effect? Like replacing the = with += here? Would like to test the return for inp 2 in this case. (should be 5)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in b5c1582


let result = this.indent + "-------Switch statement start-------\n";

let jumpTableName = "____switch" + ++this.genVarCounter
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't inline assignments (incrementor in this case).

&& ts.isCaseClause(nextClause)
&& nextClause.statements.length === 0
) {
nextClause = clauses[++i];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't inline assignments (incrementor).

@lolleko lolleko merged commit af1b806 into TypeScriptToLua:master Feb 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants