Skip to content

Remove optimization of eliding the preamble code for functions without statements.#2138

Merged
CyrusNajmabadi merged 5 commits into
masterfrom
functionEmit
Feb 25, 2015
Merged

Remove optimization of eliding the preamble code for functions without statements.#2138
CyrusNajmabadi merged 5 commits into
masterfrom
functionEmit

Conversation

@CyrusNajmabadi
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread src/compiler/emitter.ts Outdated
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i guess this isn't really necessary. If 'startIndex' were not zero, then 'preambleEmitted' would be 'true' and we wouldn't get in this branch.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Don't you need to start at 0 regardless? I presume the prologues are not actually in the body.statements array.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So now every function block will be on multiple lines?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No. Functions with preambles will alwys be on multiple lines. If thre is no preamble, then the function will stay on a single line if it was written on a single line. Otherwise, it will become multiple lines.

@JsonFreeman
Copy link
Copy Markdown
Contributor

👍

Conflicts:
	src/compiler/emitter.ts
CyrusNajmabadi added a commit that referenced this pull request Feb 25, 2015
Remove optimization of eliding the preamble code for functions without statements.
@CyrusNajmabadi CyrusNajmabadi merged commit 7b8919f into master Feb 25, 2015
@CyrusNajmabadi CyrusNajmabadi deleted the functionEmit branch February 25, 2015 22:28
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants