mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
refactoring
This commit is contained in:
+1
-4
@@ -48,10 +48,7 @@ class NodeUtils {
|
||||
return node.type === NodeType_1.NodeType.MemberExpression;
|
||||
}
|
||||
static isNodeHasBlockScope(node) {
|
||||
return (node.type === NodeType_1.NodeType.BlockStatement ||
|
||||
node.type === NodeType_1.NodeType.CatchClause ||
|
||||
node.type === NodeType_1.NodeType.FunctionExpression ||
|
||||
node.type === NodeType_1.NodeType.Program) && node.hasOwnProperty('body');
|
||||
return node.hasOwnProperty('body');
|
||||
}
|
||||
static isProgramNode(node) {
|
||||
return node.type === NodeType_1.NodeType.Program;
|
||||
|
||||
+3
-8
@@ -1,4 +1,6 @@
|
||||
import { IBlockStatementNode } from "./interfaces/nodes/IBlockStatementNode";
|
||||
import { ICatchClauseNode } from "./interfaces/nodes/ICatchClauseNode";
|
||||
import { IFunctionNode } from "./interfaces/nodes/IFunctionNode";
|
||||
import { IIdentifierNode } from "./interfaces/nodes/IIdentifierNode";
|
||||
import { ILiteralNode } from "./interfaces/nodes/ILiteralNode";
|
||||
import { IMemberExpressionNode } from "./interfaces/nodes/IMemberExpressionNode";
|
||||
@@ -10,8 +12,6 @@ import { IVariableDeclaratorNode } from "./interfaces/nodes/IVariableDeclaratorN
|
||||
import { NodeType } from "./enums/NodeType";
|
||||
|
||||
import { Utils } from "./Utils";
|
||||
import {ICatchClauseNode} from "./interfaces/nodes/ICatchClauseNode";
|
||||
import {IFunctionNode} from "./interfaces/nodes/IFunctionNode";
|
||||
|
||||
export class NodeUtils {
|
||||
/**
|
||||
@@ -129,12 +129,7 @@ export class NodeUtils {
|
||||
public static isNodeHasBlockScope (
|
||||
node: ITreeNode
|
||||
): node is IBlockStatementNode|ICatchClauseNode|IFunctionNode|IProgramNode {
|
||||
return (
|
||||
node.type === NodeType.BlockStatement ||
|
||||
node.type === NodeType.CatchClause ||
|
||||
node.type === NodeType.FunctionExpression ||
|
||||
node.type === NodeType.Program
|
||||
) && node.hasOwnProperty('body');
|
||||
return node.hasOwnProperty('body');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user