-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fix template literals with numbers #90
Conversation
@@ -4,36 +4,37 @@ | |||
**/ | |||
/* eslint-disable no-template-curly-in-string */ | |||
/* eslint-disable no-multi-str */ | |||
const { rewriteAndExpectNoTransformation, rewriteAndExpect } = require('./util') | |||
const { rewriteAst, rewriteAndExpectNoTransformation, rewriteAndExpect } = require('./util') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the changes in this file are only tabs, I'll add comments in changed points
const js = 'const result = `Hello World!${a}`;' | ||
rewriteAndExpect(js, '{\nconst result = _ddiast.plusOperator("Hello World!" + a, "Hello World!", a);\n}') | ||
}) | ||
it('Only vars', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New test here
__datadog_test_1 = (__datadog_test_0 = _ddiast.plusOperator(\'bye \' + d, \'bye \', d), _ddiast.plusOperator(\ | ||
__datadog_test_0 + "", __datadog_test_0, "")), _ddiast.plusOperator(\'how are u \' + __datadog_test_1, \'how are u \', \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small change in these lines, but nothing important, only the order from "" + __datadog_test_0
to __datadog_test_0 + ""
}) | ||
}) | ||
|
||
describe('Execution tests', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the tests in this describe
are new
What does this PR do?
Fixes some corner cases when template literals are used with numbers
Motivation
Fix the bugs
Additional Notes
Describe how to test your changes
Checklist