Skip to content

Fix isReservedName method - #451

Merged
sanex3339 merged 1 commit into
javascript-obfuscator:masterfrom
kida7:patch-2
Dec 30, 2019
Merged

sanex3339 merged 1 commit into
javascript-obfuscator:masterfrom
kida7:patch-2

Conversation

@kida7

@kida7 kida7 commented Dec 20, 2019

Copy link
Copy Markdown
Contributor

I think the line check if(!this.options.reservedStrings.length) should be change to if (!this.options.reservedNames || !this.options.reservedNames.length)

I think the line check if(!this.options.reservedStrings.length) should be change to if (!this.options.reservedNames || !this.options.reservedNames.length)
@coveralls

coveralls commented Dec 20, 2019 •

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.03%) to 98.025% when pulling ca97ebb on kida7:patch-2 into dfbb41b on javascript-obfuscator:master.

@sanex3339

sanex3339 commented Dec 20, 2019 •

Copy link
Copy Markdown
Member

Hi.
this.options.reservedNames should be always as array here, because of this preset:
https://github.com/javascript-obfuscator/javascript-obfuscator/blob/master/src/options/presets/Default.ts

If no reservedNames option was added to the obfuscator options, then the value from this will be added to the options object instead.

@sanex3339

Copy link
Copy Markdown
Member

Oh. Thank you, i was wrong. Fixed it on my side with tests

@sanex3339
sanex3339 merged commit a138ff9 into javascript-obfuscator:master Dec 30, 2019
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