replaced let on const in for-of loops

This commit is contained in:
sanex3339
2016-10-16 01:10:02 +03:00
parent 1fc50304b5
commit ba49e8edcd
5 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -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;
}
+2 -2
View File
@@ -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));
}
+2 -2
View File
@@ -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)) {
@@ -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 =