feat: refactoring project
This commit is contained in:
23
node_modules/terser/lib/compress/evaluate.js
generated
vendored
23
node_modules/terser/lib/compress/evaluate.js
generated
vendored
@@ -218,14 +218,25 @@ def_eval(AST_Object, function (compressor, depth) {
|
||||
var non_converting_unary = makePredicate("! typeof void");
|
||||
def_eval(AST_UnaryPrefix, function (compressor, depth) {
|
||||
var e = this.expression;
|
||||
// Function would be evaluated to an array and so typeof would
|
||||
// incorrectly return 'object'. Hence making is a special case.
|
||||
if (compressor.option("typeofs")
|
||||
&& this.operator == "typeof"
|
||||
&& (e instanceof AST_Lambda
|
||||
&& this.operator == "typeof") {
|
||||
// Function would be evaluated to an array and so typeof would
|
||||
// incorrectly return 'object'. Hence making is a special case.
|
||||
if (e instanceof AST_Lambda
|
||||
|| e instanceof AST_SymbolRef
|
||||
&& e.fixed_value() instanceof AST_Lambda)) {
|
||||
return typeof function () { };
|
||||
&& e.fixed_value() instanceof AST_Lambda) {
|
||||
return typeof function () { };
|
||||
}
|
||||
if (
|
||||
(e instanceof AST_Object
|
||||
|| e instanceof AST_Array
|
||||
|| (e instanceof AST_SymbolRef
|
||||
&& (e.fixed_value() instanceof AST_Object
|
||||
|| e.fixed_value() instanceof AST_Array)))
|
||||
&& !e.has_side_effects(compressor)
|
||||
) {
|
||||
return typeof {};
|
||||
}
|
||||
}
|
||||
if (!non_converting_unary.has(this.operator))
|
||||
depth++;
|
||||
|
||||
Reference in New Issue
Block a user