feat: refactoring project

This commit is contained in:
Carlos
2024-11-23 14:56:07 -05:00
parent f0c2a50c18
commit 1c6db5818d
2351 changed files with 39323 additions and 60326 deletions

View File

@@ -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++;