编程语言/uglify:修订间差异
来自康健生活
< 编程语言
| 第4行: | 第4行: | ||
const uglify = require('uglify-js');</syntaxhighlight> | const uglify = require('uglify-js');</syntaxhighlight> | ||
uglify | uglify 上的属性方法有如下,左侧是 uglify-js{{Version|1.3.5}},右侧是 uglify-js{{Version|3.15.2}}: | ||
< | {{hcdiff|head=|output=<syntaxhighlight lang="bash"> | ||
0: 'parser': | |||
0: 'tokenizer' | |||
1: 'parse' | |||
2: 'slice' | |||
3: 'curry' | |||
4: 'member' | |||
5: 'array_to_hash' | |||
6: 'PRECEDENCE' | |||
7: 'KEYWORDS_ATOM' | |||
8: 'RESERVED_WORDS' | |||
9: 'KEYWORDS' | |||
10: 'ATOMIC_START_TOKEN' | |||
11: 'OPERATORS' | |||
12: 'is_alphanumeric_char' | |||
13: 'is_identifier_start' | |||
14: 'is_identifier_char' | |||
15: 'set_logger' | |||
length: 16 | |||
[[Prototype]]: Array(0) | |||
[[Prototype]]: Object | |||
1: 'uglify': | |||
0: 'ast_walker' | |||
1: 'ast_mangle' | |||
2: 'ast_squeeze' | |||
3: 'ast_lift_variables' | |||
4: 'gen_code' | |||
5: 'ast_add_scope' | |||
6: 'set_logger' | |||
7: 'make_string' | |||
8: 'split_lines' | |||
9: 'MAP' | |||
10: 'ast_squeeze_more' | |||
length: 11 | |||
[[Prototype]]: Array(0) | |||
[[Prototype]]: Object | |||
2: 'consolidator' | |||
0: 'ast_consolidate' | |||
length: 1 | |||
[[Prototype]]: Array(0) | |||
[[Prototype]]: Object | |||
length: 3 | |||
[[Prototype]]: Array(0) | |||
[[Prototype]]: Object | |||
</syntaxhighlight>|output2=<syntaxhighlight lang="bash"> | |||
0: 'FILES' | 0: 'FILES' | ||
1: 'AST_Token' | 1: 'AST_Token' | ||
| 第152行: | 第196行: | ||
length: 144 | length: 144 | ||
[[Prototype]]: Array(0) | [[Prototype]]: Array(0) | ||
[[Prototype]]: Object</ | [[Prototype]]: Object | ||
</syntaxhighlight>}} | |||
== 版本升级 == | == 版本升级 == | ||
遇到一个需求,升级 uglify 的版本,在原有的 uglify{{Version|1.3.5}} 中,有用到 <code>uglify.parser.tokenizer</code> 分词器。 | 遇到一个需求,升级 uglify 的版本,在原有的 uglify{{Version|1.3.5}} 中,有用到 <code>uglify.parser.tokenizer</code> 分词器。 | ||
2022年3月7日 (一) 07:45的版本
引言
引用 uglify-js。
const uglify = require('uglify-js');
uglify 上的属性方法有如下,左侧是 uglify-js,右侧是 uglify-js:
0: 'parser':
0: 'tokenizer'
1: 'parse'
2: 'slice'
3: 'curry'
4: 'member'
5: 'array_to_hash'
6: 'PRECEDENCE'
7: 'KEYWORDS_ATOM'
8: 'RESERVED_WORDS'
9: 'KEYWORDS'
10: 'ATOMIC_START_TOKEN'
11: 'OPERATORS'
12: 'is_alphanumeric_char'
13: 'is_identifier_start'
14: 'is_identifier_char'
15: 'set_logger'
length: 16
[[Prototype]]: Array(0)
[[Prototype]]: Object
1: 'uglify':
0: 'ast_walker'
1: 'ast_mangle'
2: 'ast_squeeze'
3: 'ast_lift_variables'
4: 'gen_code'
5: 'ast_add_scope'
6: 'set_logger'
7: 'make_string'
8: 'split_lines'
9: 'MAP'
10: 'ast_squeeze_more'
length: 11
[[Prototype]]: Array(0)
[[Prototype]]: Object
2: 'consolidator'
0: 'ast_consolidate'
length: 1
[[Prototype]]: Array(0)
[[Prototype]]: Object
length: 3
[[Prototype]]: Array(0)
[[Prototype]]: Object
0: 'FILES'
1: 'AST_Token'
2: 'AST_Node'
3: 'AST_Statement'
4: 'AST_Debugger'
5: 'AST_Directive'
6: 'AST_EmptyStatement'
7: 'AST_SimpleStatement'
8: 'AST_BlockScope'
9: 'AST_Block'
10: 'AST_BlockStatement'
11: 'AST_StatementWithBody'
12: 'AST_LabeledStatement'
13: 'AST_IterationStatement'
14: 'AST_DWLoop'
15: 'AST_Do'
16: 'AST_While'
17: 'AST_For'
18: 'AST_ForEnumeration'
19: 'AST_ForIn'
20: 'AST_ForOf'
21: 'AST_ForAwaitOf'
22: 'AST_With'
23: 'AST_Scope'
24: 'AST_Toplevel'
25: 'AST_Lambda'
26: 'AST_Accessor'
27: 'AST_LambdaExpression'
28: 'AST_Arrow'
29: 'AST_AsyncArrow'
30: 'AST_AsyncFunction'
31: 'AST_AsyncGeneratorFunction'
32: 'AST_Function'
33: 'AST_GeneratorFunction'
34: 'AST_LambdaDefinition'
35: 'AST_AsyncDefun'
36: 'AST_AsyncGeneratorDefun'
37: 'AST_Defun'
38: 'AST_GeneratorDefun'
39: 'AST_Class'
40: 'AST_DefClass'
41: 'AST_ClassExpression'
42: 'AST_ClassProperty'
43: 'AST_ClassField'
44: 'AST_ClassGetter'
45: 'AST_ClassSetter'
46: 'AST_ClassMethod'
47: 'AST_Jump'
48: 'AST_Exit'
49: 'AST_Return'
50: 'AST_Throw'
51: 'AST_LoopControl'
52: 'AST_Break'
53: 'AST_Continue'
54: 'AST_If'
55: 'AST_Switch'
56: 'AST_SwitchBranch'
57: 'AST_Default'
58: 'AST_Case'
59: 'AST_Try'
60: 'AST_Catch'
61: 'AST_Finally'
62: 'AST_Definitions'
63: 'AST_Const'
64: 'AST_Let'
65: 'AST_Var'
66: 'AST_VarDef'
67: 'AST_ExportDeclaration'
68: 'AST_ExportDefault'
69: 'AST_ExportForeign'
70: 'AST_ExportReferences'
71: 'AST_Import'
72: 'AST_DefaultValue'
73: 'AST_Call'
74: 'AST_New'
75: 'AST_Sequence'
76: 'AST_PropAccess'
77: 'AST_Dot'
78: 'AST_Sub'
79: 'AST_Spread'
80: 'AST_Unary'
81: 'AST_UnaryPrefix'
82: 'AST_UnaryPostfix'
83: 'AST_Binary'
84: 'AST_Conditional'
85: 'AST_Assign'
86: 'AST_Await'
87: 'AST_Yield'
88: 'AST_Array'
89: 'AST_Destructured'
90: 'AST_DestructuredArray'
91: 'AST_DestructuredKeyVal'
92: 'AST_DestructuredObject'
93: 'AST_Object'
94: 'AST_ObjectProperty'
95: 'AST_ObjectKeyVal'
96: 'AST_ObjectMethod'
97: 'AST_ObjectSetter'
98: 'AST_ObjectGetter'
99: 'AST_Symbol'
100: 'AST_SymbolDeclaration'
101: 'AST_SymbolConst'
102: 'AST_SymbolImport'
103: 'AST_SymbolLet'
104: 'AST_SymbolVar'
105: 'AST_SymbolFunarg'
106: 'AST_SymbolDefun'
107: 'AST_SymbolLambda'
108: 'AST_SymbolDefClass'
109: 'AST_SymbolClass'
110: 'AST_SymbolCatch'
111: 'AST_Label'
112: 'AST_SymbolRef'
113: 'AST_SymbolExport'
114: 'AST_LabelRef'
115: 'AST_ObjectIdentity'
116: 'AST_Super'
117: 'AST_This'
118: 'AST_NewTarget'
119: 'AST_Template'
120: 'AST_Constant'
121: 'AST_String'
122: 'AST_Number'
123: 'AST_BigInt'
124: 'AST_RegExp'
125: 'AST_Atom'
126: 'AST_Null'
127: 'AST_NaN'
128: 'AST_Undefined'
129: 'AST_Hole'
130: 'AST_Infinity'
131: 'AST_Boolean'
132: 'AST_False'
133: 'AST_True'
134: 'Dictionary'
135: 'is_statement'
136: 'List'
137: 'minify'
138: 'parse'
139: 'push_uniq'
140: 'TreeTransformer'
141: 'TreeWalker'
142: 'describe_ast'
143: 'default_options'
length: 144
[[Prototype]]: Array(0)
[[Prototype]]: Object
版本升级
遇到一个需求,升级 uglify 的版本,在原有的 uglify 中,有用到 uglify.parser.tokenizer 分词器。
No categories