mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
replaced let on const in for-of loops
This commit is contained in:
@@ -102,7 +102,7 @@ export class JavaScriptObfuscatorCLI {
|
||||
let obfuscatorOptions: IObfuscatorOptions = {},
|
||||
availableOptions: string[] = Object.keys(DEFAULT_PRESET);
|
||||
|
||||
for (let option in this.commands) {
|
||||
for (const option in this.commands) {
|
||||
if (!this.commands.hasOwnProperty(option)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ export class OptionsNormalizer {
|
||||
public static normalizeOptions (options: IOptions): IOptions {
|
||||
let normalizedOptions: IOptions = Object.assign({}, options);
|
||||
|
||||
for (let normalizerRule of OptionsNormalizer.normalizerRules) {
|
||||
for (const normalizerRule of OptionsNormalizer.normalizerRules) {
|
||||
normalizedOptions = normalizerRule(normalizedOptions);
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ export class OptionsNormalizer {
|
||||
if (options.domainLock.length) {
|
||||
let normalizedDomains: string[] = [];
|
||||
|
||||
for (let domain of options.domainLock) {
|
||||
for (const domain of options.domainLock) {
|
||||
normalizedDomains.push(Utils.extractDomainFromUrl(domain));
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ export class ValidationErrorsFormatter {
|
||||
public static format (validationErrors: ValidationError[]): string {
|
||||
let errorsArray: string[] = [];
|
||||
|
||||
for (let error of validationErrors) {
|
||||
for (const error of validationErrors) {
|
||||
errorsArray.push(ValidationErrorsFormatter.formatError(error));
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ export class ValidationErrorsFormatter {
|
||||
let errorString: string = `\`${validationError.property}\` errors:\n`,
|
||||
constraints: {[type: string]: string} = validationError.constraints;
|
||||
|
||||
for (let constraint in constraints) {
|
||||
for (const constraint in constraints) {
|
||||
if (!constraints.hasOwnProperty(constraint)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ export class StackTraceAnalyzer implements IStackTraceAnalyzer {
|
||||
private analyzeRecursive (blockScopeBody: ESTree.Node[]): IStackTraceData[] {
|
||||
const stackTraceData: IStackTraceData[] = [];
|
||||
|
||||
for (let rootNode of blockScopeBody) {
|
||||
for (const rootNode of blockScopeBody) {
|
||||
estraverse.traverse(rootNode, {
|
||||
enter: (node: ESTree.Node): any => {
|
||||
if (!Nodes.isCallExpressionNode(node) || rootNode.parentNode !== NodeUtils.getBlockScopeOfNode(node)) {
|
||||
|
||||
+1
-1
@@ -134,7 +134,7 @@ export class ObjectExpressionCalleeDataExtractor implements ICalleeDataExtractor
|
||||
return null;
|
||||
}
|
||||
|
||||
for (let propertyNode of objectExpressionProperties) {
|
||||
for (const propertyNode of objectExpressionProperties) {
|
||||
const isTargetPropertyNodeWithIdentifierKey: boolean =
|
||||
Nodes.isIdentifierNode(propertyNode.key) && propertyNode.key.name === nextItemInCallsChain;
|
||||
const isTargetPropertyNodeWithLiteralKey: boolean =
|
||||
|
||||
Reference in New Issue
Block a user