From 26fa49f4b0aa658d65a21fffe828f39e78302573 Mon Sep 17 00:00:00 2001 From: HelenHuang <LinHuang@pollex.com.tw> Date: 星期四, 09 六月 2022 17:46:58 +0800 Subject: [PATCH] Revert "Update#139889 [ 快速篩選 ] 年資文案調整" --- PAMapp/node_modules/terser-webpack-plugin/node_modules/terser/lib/equivalent-to.js | 188 ++++++++++++++++++++-------------------------- 1 files changed, 81 insertions(+), 107 deletions(-) diff --git a/PAMapp/node_modules/terser-webpack-plugin/node_modules/terser/lib/equivalent-to.js b/PAMapp/node_modules/terser-webpack-plugin/node_modules/terser/lib/equivalent-to.js index 0597621..c0e7173 100644 --- a/PAMapp/node_modules/terser-webpack-plugin/node_modules/terser/lib/equivalent-to.js +++ b/PAMapp/node_modules/terser-webpack-plugin/node_modules/terser/lib/equivalent-to.js @@ -97,24 +97,6 @@ return walk_1_state.length == 0 && walk_2_state.length == 0; }; -// Creates a shallow compare function -const mkshallow = (props) => { - const comparisons = Object - .keys(props) - .map(key => { - if (props[key] === "eq") { - return `this.${key} === other.${key}`; - } else if (props[key] === "exist") { - return `(this.${key} == null ? other.${key} == null : this.${key} === other.${key})`; - } else { - throw new Error(`mkshallow: Unexpected instruction: ${props[key]}`); - } - }) - .join(" && "); - - return new Function("other", "return " + comparisons); -}; - const pass_through = () => true; AST_Node.prototype.shallow_cmp = function () { @@ -123,7 +105,9 @@ AST_Debugger.prototype.shallow_cmp = pass_through; -AST_Directive.prototype.shallow_cmp = mkshallow({ value: "eq" }); +AST_Directive.prototype.shallow_cmp = function(other) { + return this.value === other.value; +}; AST_SimpleStatement.prototype.shallow_cmp = pass_through; @@ -131,17 +115,17 @@ AST_EmptyStatement.prototype.shallow_cmp = pass_through; -AST_LabeledStatement.prototype.shallow_cmp = mkshallow({ "label.name": "eq" }); +AST_LabeledStatement.prototype.shallow_cmp = function(other) { + return this.label.name === other.label.name; +}; AST_Do.prototype.shallow_cmp = pass_through; AST_While.prototype.shallow_cmp = pass_through; -AST_For.prototype.shallow_cmp = mkshallow({ - init: "exist", - condition: "exist", - step: "exist" -}); +AST_For.prototype.shallow_cmp = function(other) { + return (this.init == null ? other.init == null : this.init === other.init) && (this.condition == null ? other.condition == null : this.condition === other.condition) && (this.step == null ? other.step == null : this.step === other.step); +}; AST_ForIn.prototype.shallow_cmp = pass_through; @@ -153,22 +137,21 @@ AST_Expansion.prototype.shallow_cmp = pass_through; -AST_Lambda.prototype.shallow_cmp = mkshallow({ - is_generator: "eq", - async: "eq" -}); +AST_Lambda.prototype.shallow_cmp = function(other) { + return this.is_generator === other.is_generator && this.async === other.async; +}; -AST_Destructuring.prototype.shallow_cmp = mkshallow({ - is_array: "eq" -}); +AST_Destructuring.prototype.shallow_cmp = function(other) { + return this.is_array === other.is_array; +}; AST_PrefixedTemplateString.prototype.shallow_cmp = pass_through; AST_TemplateString.prototype.shallow_cmp = pass_through; -AST_TemplateSegment.prototype.shallow_cmp = mkshallow({ - "value": "eq" -}); +AST_TemplateSegment.prototype.shallow_cmp = function(other) { + return this.value === other.value; +}; AST_Jump.prototype.shallow_cmp = pass_through; @@ -176,51 +159,45 @@ AST_Await.prototype.shallow_cmp = pass_through; -AST_Yield.prototype.shallow_cmp = mkshallow({ - is_star: "eq" -}); +AST_Yield.prototype.shallow_cmp = function(other) { + return this.is_star === other.is_star; +}; -AST_If.prototype.shallow_cmp = mkshallow({ - alternative: "exist" -}); +AST_If.prototype.shallow_cmp = function(other) { + return this.alternative == null ? other.alternative == null : this.alternative === other.alternative; +}; AST_Switch.prototype.shallow_cmp = pass_through; AST_SwitchBranch.prototype.shallow_cmp = pass_through; -AST_Try.prototype.shallow_cmp = mkshallow({ - bcatch: "exist", - bfinally: "exist" -}); +AST_Try.prototype.shallow_cmp = function(other) { + return (this.bcatch == null ? other.bcatch == null : this.bcatch === other.bcatch) && (this.bfinally == null ? other.bfinally == null : this.bfinally === other.bfinally); +}; -AST_Catch.prototype.shallow_cmp = mkshallow({ - argname: "exist" -}); +AST_Catch.prototype.shallow_cmp = function(other) { + return this.argname == null ? other.argname == null : this.argname === other.argname; +}; AST_Finally.prototype.shallow_cmp = pass_through; AST_Definitions.prototype.shallow_cmp = pass_through; -AST_VarDef.prototype.shallow_cmp = mkshallow({ - value: "exist" -}); +AST_VarDef.prototype.shallow_cmp = function(other) { + return this.value == null ? other.value == null : this.value === other.value; +}; AST_NameMapping.prototype.shallow_cmp = pass_through; -AST_Import.prototype.shallow_cmp = mkshallow({ - imported_name: "exist", - imported_names: "exist" -}); +AST_Import.prototype.shallow_cmp = function(other) { + return (this.imported_name == null ? other.imported_name == null : this.imported_name === other.imported_name) && (this.imported_names == null ? other.imported_names == null : this.imported_names === other.imported_names); +}; AST_ImportMeta.prototype.shallow_cmp = pass_through; -AST_Export.prototype.shallow_cmp = mkshallow({ - exported_definition: "exist", - exported_value: "exist", - exported_names: "exist", - module_name: "eq", - is_default: "eq", -}); +AST_Export.prototype.shallow_cmp = function(other) { + return (this.exported_definition == null ? other.exported_definition == null : this.exported_definition === other.exported_definition) && (this.exported_value == null ? other.exported_value == null : this.exported_value === other.exported_value) && (this.exported_names == null ? other.exported_names == null : this.exported_names === other.exported_names) && this.module_name === other.module_name && this.is_default === other.is_default; +}; AST_Call.prototype.shallow_cmp = pass_through; @@ -230,21 +207,21 @@ AST_Chain.prototype.shallow_cmp = pass_through; -AST_Dot.prototype.shallow_cmp = mkshallow({ - property: "eq" -}); +AST_Dot.prototype.shallow_cmp = function(other) { + return this.property === other.property; +}; -AST_DotHash.prototype.shallow_cmp = mkshallow({ - property: "eq" -}); +AST_DotHash.prototype.shallow_cmp = function(other) { + return this.property === other.property; +}; -AST_Unary.prototype.shallow_cmp = mkshallow({ - operator: "eq" -}); +AST_Unary.prototype.shallow_cmp = function(other) { + return this.operator === other.operator; +}; -AST_Binary.prototype.shallow_cmp = mkshallow({ - operator: "eq" -}); +AST_Binary.prototype.shallow_cmp = function(other) { + return this.operator === other.operator; +}; AST_Conditional.prototype.shallow_cmp = pass_through; @@ -254,36 +231,33 @@ AST_ObjectProperty.prototype.shallow_cmp = pass_through; -AST_ObjectKeyVal.prototype.shallow_cmp = mkshallow({ - key: "eq" -}); +AST_ObjectKeyVal.prototype.shallow_cmp = function(other) { + return this.key === other.key; +}; -AST_ObjectSetter.prototype.shallow_cmp = mkshallow({ - static: "eq" -}); +AST_ObjectSetter.prototype.shallow_cmp = function(other) { + return this.static === other.static; +}; -AST_ObjectGetter.prototype.shallow_cmp = mkshallow({ - static: "eq" -}); +AST_ObjectGetter.prototype.shallow_cmp = function(other) { + return this.static === other.static; +}; -AST_ConciseMethod.prototype.shallow_cmp = mkshallow({ - static: "eq", - is_generator: "eq", - async: "eq", -}); +AST_ConciseMethod.prototype.shallow_cmp = function(other) { + return this.static === other.static && this.is_generator === other.is_generator && this.async === other.async; +}; -AST_Class.prototype.shallow_cmp = mkshallow({ - name: "exist", - extends: "exist", -}); +AST_Class.prototype.shallow_cmp = function(other) { + return (this.name == null ? other.name == null : this.name === other.name) && (this.extends == null ? other.extends == null : this.extends === other.extends); +}; -AST_ClassProperty.prototype.shallow_cmp = mkshallow({ - static: "eq" -}); +AST_ClassProperty.prototype.shallow_cmp = function(other) { + return this.static === other.static; +}; -AST_Symbol.prototype.shallow_cmp = mkshallow({ - name: "eq" -}); +AST_Symbol.prototype.shallow_cmp = function(other) { + return this.name === other.name; +}; AST_NewTarget.prototype.shallow_cmp = pass_through; @@ -291,17 +265,17 @@ AST_Super.prototype.shallow_cmp = pass_through; -AST_String.prototype.shallow_cmp = mkshallow({ - value: "eq" -}); +AST_String.prototype.shallow_cmp = function(other) { + return this.value === other.value; +}; -AST_Number.prototype.shallow_cmp = mkshallow({ - value: "eq" -}); +AST_Number.prototype.shallow_cmp = function(other) { + return this.value === other.value; +}; -AST_BigInt.prototype.shallow_cmp = mkshallow({ - value: "eq" -}); +AST_BigInt.prototype.shallow_cmp = function(other) { + return this.value === other.value; +}; AST_RegExp.prototype.shallow_cmp = function (other) { return ( -- Gitblit v1.8.0