|
@@ -1,3 +1,4 @@
|
|
|
|
+/* eslint-disable no-console */
|
|
import { inject, injectable, } from 'inversify';
|
|
import { inject, injectable, } from 'inversify';
|
|
import { ServiceIdentifiers } from '../../../container/ServiceIdentifiers';
|
|
import { ServiceIdentifiers } from '../../../container/ServiceIdentifiers';
|
|
|
|
|
|
@@ -17,6 +18,16 @@ import { NodeFactory } from '../../../node/NodeFactory';
|
|
|
|
|
|
@injectable()
|
|
@injectable()
|
|
export class RenamePropertiesReplacer implements IRenamePropertiesReplacer {
|
|
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 <[email protected]>
|
|
|
|
+ *
|
|
|
|
+ * @type {Set<string>}
|
|
|
|
+ */
|
|
|
|
+ private static readonly reservedDomPropertiesList: Set<string> = new Set(ReservedDomProperties);
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @type {IIdentifierNamesGenerator}
|
|
* @type {IIdentifierNamesGenerator}
|
|
*/
|
|
*/
|
|
@@ -33,17 +44,6 @@ export class RenamePropertiesReplacer implements IRenamePropertiesReplacer {
|
|
*/
|
|
*/
|
|
private readonly options: IOptions;
|
|
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 <[email protected]>
|
|
|
|
- *
|
|
|
|
- * @type {Set<string>}
|
|
|
|
- */
|
|
|
|
- private readonly reservedDomPropertiesList: Set<string> = new Set(ReservedDomProperties);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory
|
|
* @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory
|
|
* @param {IOptions} options
|
|
* @param {IOptions} options
|
|
@@ -128,6 +128,6 @@ export class RenamePropertiesReplacer implements IRenamePropertiesReplacer {
|
|
* @returns {boolean}
|
|
* @returns {boolean}
|
|
*/
|
|
*/
|
|
private isReservedDomPropertyName (name: string): boolean {
|
|
private isReservedDomPropertyName (name: string): boolean {
|
|
- return this.reservedDomPropertiesList.has(name);
|
|
|
|
|
|
+ return RenamePropertiesReplacer.reservedDomPropertiesList.has(name);
|
|
}
|
|
}
|
|
}
|
|
}
|