-
-
Notifications
You must be signed in to change notification settings - Fork 225
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
Add fix for other types of nodes in referencePaths #123
Conversation
boopathi
commented
Aug 29, 2016
- (Close Unexpected UnaryExpression. Expected an Identifier #122)
- (Close ModuleBuildError: Module build failed: TypeError: Cannot read property 'scope' of undefined #105)
@@ -873,4 +873,34 @@ describe("mangle-names", () => { | |||
`); | |||
expect(transform(source)).toBe(expected); | |||
}); | |||
|
|||
it("should handle export declarations", () => { |
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.
should add this to DCE as well... or shall I add it to preset tests ?
regarding #122 , strangely it happens only for function foo () {
var a;
if (a) {} else {
b()
}
} and not for function foo () {
if (a) {} else {
b()
}
} this is replaced to function foo () {
var a;
if (!a) {
b()
}
} and the referencePath of |
const babel = require("babel-core"); | ||
const unpad = require("../../../utils/unpad"); | ||
|
||
function transform(code, options = {}, sourceType = "script") { |
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.
Maybe it would make sense to move transform
to utils and share among tests to avoid duplication?
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.
Yeah.. Like discussed here #76 ... separate PR for all these things ...
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.
Oh right, I forgot :) If you can make a PR for that, I'd gladly merge — would make tests a bit cleaner.