Skip to content

Commit 2c58db2

Browse files
author
sanex3339
committed
WIP: tryig to remove some logic from domain lock custom node group
1 parent 2b48efa commit 2c58db2

File tree

5 files changed

+12
-14
lines changed

5 files changed

+12
-14
lines changed

dist/index.browser.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.cli.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/custom-code-helpers/domain-lock/group/DomainLockCustomCodeHelperGroup.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import { CallsControllerFunctionCodeHelper } from '../../calls-controller/CallsC
2222
import { DomainLockCodeHelper } from '../DomainLockCodeHelper';
2323
import { NodeAppender } from '../../../node/NodeAppender';
2424
import { NodeLexicalScopeUtils } from '../../../node/NodeLexicalScopeUtils';
25-
import { NodeGuards } from '../../../node/NodeGuards';
2625

2726
@injectable()
2827
export class DomainLockCustomCodeHelperGroup extends AbstractCustomCodeHelperGroup {
@@ -82,11 +81,9 @@ export class DomainLockCustomCodeHelperGroup extends AbstractCustomCodeHelperGro
8281
.getLexicalScope(domainLockFunctionHostNode) ?? null;
8382

8483
const domainLockFunctionName: string = domainLockFunctionLexicalScopeNode
85-
&& NodeGuards.isProgramNode(domainLockFunctionLexicalScopeNode)
8684
? this.identifierNamesGenerator.generate(domainLockFunctionLexicalScopeNode)
8785
: this.identifierNamesGenerator.generateNext();
8886
const callsControllerFunctionName: string = domainLockFunctionLexicalScopeNode
89-
&& NodeGuards.isProgramNode(domainLockFunctionLexicalScopeNode)
9087
? this.identifierNamesGenerator.generate(domainLockFunctionLexicalScopeNode)
9188
: this.identifierNamesGenerator.generateNext();
9289

test/runtime-tests/JavaScriptObfuscatorRuntime.spec.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { assert } from 'chai';
22

33
import { TInputOptions } from '../../src/types/options/TInputOptions';
44

5+
import { StringArrayEncoding } from '../../src/enums/StringArrayEncoding';
56
import { IdentifierNamesGenerator } from '../../src/enums/generators/identifier-names-generators/IdentifierNamesGenerator';
67

78
import { evaluateInWorker } from '../helpers/evaluateInWorker';
@@ -17,10 +18,10 @@ const getEnvironmentCode = () => `
1718

1819
describe('JavaScriptObfuscator runtime eval', function () {
1920
const baseOptions: TInputOptions = {
20-
/*controlFlowFlattening: true,
21+
controlFlowFlattening: true,
2122
controlFlowFlatteningThreshold: 1,
2223
deadCodeInjection: true,
23-
deadCodeInjectionThreshold: 1,*/
24+
deadCodeInjectionThreshold: 1,
2425
debugProtection: true,
2526
disableConsoleOutput: true,
2627
domainLock: ['obfuscator.io'],
@@ -29,13 +30,13 @@ describe('JavaScriptObfuscator runtime eval', function () {
2930
reservedNames: ['generate', 'sha256'],
3031
rotateStringArray: true,
3132
selfDefending: true,
32-
/*splitStrings: true,*/
33-
/*splitStringsChunkLength: 5,*/
33+
splitStrings: true,
34+
splitStringsChunkLength: 5,
3435
stringArray: true,
35-
/*stringArrayEncoding: StringArrayEncoding.Rc4,*/
36-
/*stringArrayThreshold: 1,*/
37-
/*transformObjectKeys: true,*/
38-
/*unicodeEscapeSequence: true*/
36+
stringArrayEncoding: StringArrayEncoding.Rc4,
37+
stringArrayThreshold: 1,
38+
transformObjectKeys: true,
39+
unicodeEscapeSequence: true
3940
};
4041

4142
this.timeout(200000);

0 commit comments

Comments
 (0)