Skip to content
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

Make template token objects adhere token object structure #343

Merged
merged 3 commits into from Jul 10, 2017
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/token-translator.js
Expand Up @@ -57,7 +57,9 @@ function convertTemplatePart(tokens, code) {
}

if (firstToken.range) {
token.range = [firstToken.range[0], lastTemplateToken.range[1]];
token.start = firstToken.range[0];
token.end = lastTemplateToken.range[1];
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

nbd but maybe token.range = [token.start, token.end] after these lines would reduce some of the duplication?

token.range = [token.start, token.end];
}

return token;
Expand Down