Skip to content

Handle shebang, emit helpers, prologues and triple slash refs in prepend nodes #29582

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from

Conversation

sheetalkamat
Copy link
Member

Fixes #25550

// Helpers
let helpers: UnscopedEmitHelpers[] | undefined;
while (true) {
const helperInfo = tryGetUnscopedEmitHelper(text, pos);
Copy link
Member

Choose a reason for hiding this comment

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

Should we even be scanning for helpers or prologues if the source type is a "dts"? Likewise, should we bother scanning for triple slash directives in "js"?

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess we can but we need to make a note that if some such future common header like functionality needs to be added to consider both emits since emitter doesn't distinguish these concepts between dts or js and goes with transformed nodes.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, doesn't that imply that the factory function should just take the nodes/fields as children and that there should be parser helpers for fetching them from the text (rather than the factory function automatically producing them itself)?

@sheetalkamat
Copy link
Member Author

Closing this in favor of #29630

@sheetalkamat sheetalkamat deleted the prepend branch January 30, 2019 16:47
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