mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
reservedDomPropertiesList property is now static
This commit is contained in:
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+12
-12
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user