10000 Fix bug #360: No Global variable renaming after 2 import declarations by zamotkin · Pull Request #485 · javascript-obfuscator/javascript-obfuscator · GitHub
[go: up one dir, main page]

Skip to content

Fix bug #360: No Global variable renaming after 2 import declarations #485

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

Merged
merged 1 commit into from
Jan 9, 2020

Conversation

zamotkin
Copy link
Member
@zamotkin zamotkin commented Jan 7, 2020

Bug #360

@zamotkin zamotkin requested a review from sanex3339 January 7, 2020 15:58
@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 98.292% when pulling 7a720af on bug/360-no-global-renaming-after-two-imports into f355309 on master.

@@ -142,7 +142,6 @@ export class ImportDeclarationTransformer extends AbstractNodeTransformer {
.replace(replaceableIdentifier.name, lexicalScopeNode);

replaceableIdentifier.name = newReplaceableIdentifier.name;
NodeMetadata.set(replaceableIdentifier, { renamedIdentifier: true });
Copy link
Member

Choose a reason for hiding this comment

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

I think it is better to wrap this line and the line above in the condition

if (replaceableIdentifier.name !== newReplaceableIdentifier.name) {
                replaceableIdentifier.name = newReplaceableIdentifier.name;
                NodeMetadata.set(replaceableIdentifier, { renamedIdentifier: true });
            }

...NO_ADDITIONAL_NODES_PRESET,
compact: true,
renameGlobals: true,
identifierNamesGenerator: 'mangled'
Copy link
Member

Choose a reason for hiding this comment

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

I think it is better to keep the default hexadecimal generator here

@sanex3339 sanex3339 merged commit 2502a5d into master Jan 9, 2020
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.

3 participants
0