reservedDomPropertiesList property is now static

This commit is contained in:
sanex
2020-12-27 16:32:15 +03:00
parent 2546b27c09
commit e5762d2993
4 changed files with 15 additions and 15 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import { inject, injectable, } from 'inversify';
import { ServiceIdentifiers } from '../../../container/ServiceIdentifiers';
@@ -17,6 +18,16 @@ import { NodeFactory } from '../../../node/NodeFactory';
@injectable()
export class RenamePropertiesReplacer implements IRenamePropertiesReplacer {
/**
* Properties list taken from `UglifyJS` and `terser`
* https://github.com/mishoo/UglifyJS/blob/master/tools/domprops.json
* https://github.com/terser/terser/blob/master/tools/domprops.js
* Copyright 2012-2018 (c) Mihai Bazon <mihai.bazon@gmail.com>
*
* @type {Set<string>}
*/
private static readonly reservedDomPropertiesList: Set<string> = new Set(ReservedDomProperties);
/**
* @type {IIdentifierNamesGenerator}
*/
@@ -33,17 +44,6 @@ export class RenamePropertiesReplacer implements IRenamePropertiesReplacer {
*/
private readonly options: IOptions;
/**
* Properties list taken from `UglifyJS` and `terser`
* https://github.com/mishoo/UglifyJS/blob/master/tools/domprops.json
* https://github.com/terser/terser/blob/master/tools/domprops.js
* Copyright 2012-2018 (c) Mihai Bazon <mihai.bazon@gmail.com>
*
* @type {Set<string>}
*/
private readonly reservedDomPropertiesList: Set<string> = new Set(ReservedDomProperties);
/**
* @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory
* @param {IOptions} options
@@ -128,6 +128,6 @@ export class RenamePropertiesReplacer implements IRenamePropertiesReplacer {
* @returns {boolean}
*/
private isReservedDomPropertyName (name: string): boolean {
return this.reservedDomPropertiesList.has(name);
return RenamePropertiesReplacer.reservedDomPropertiesList.has(name);
}
}