terser 5.6.1 → 5.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,675 @@
1
+ /***********************************************************************
2
+
3
+ A JavaScript tokenizer / parser / beautifier / compressor.
4
+ https://github.com/mishoo/UglifyJS2
5
+
6
+ -------------------------------- (C) ---------------------------------
7
+
8
+ Author: Mihai Bazon
9
+ <mihai.bazon@gmail.com>
10
+ http://mihai.bazon.net/blog
11
+
12
+ Distributed under the BSD license:
13
+
14
+ Copyright 2012 (c) Mihai Bazon <mihai.bazon@gmail.com>
15
+
16
+ Redistribution and use in source and binary forms, with or without
17
+ modification, are permitted provided that the following conditions
18
+ are met:
19
+
20
+ * Redistributions of source code must retain the above
21
+ copyright notice, this list of conditions and the following
22
+ disclaimer.
23
+
24
+ * Redistributions in binary form must reproduce the above
25
+ copyright notice, this list of conditions and the following
26
+ disclaimer in the documentation and/or other materials
27
+ provided with the distribution.
28
+
29
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
30
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
32
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
33
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
34
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
35
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
36
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
38
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
39
+ THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
40
+ SUCH DAMAGE.
41
+
42
+ ***********************************************************************/
43
+
44
+ import {
45
+ AST_Accessor,
46
+ AST_Array,
47
+ AST_Assign,
48
+ AST_Await,
49
+ AST_Binary,
50
+ AST_Block,
51
+ AST_Call,
52
+ AST_Case,
53
+ AST_Chain,
54
+ AST_Class,
55
+ AST_ClassExpression,
56
+ AST_Conditional,
57
+ AST_Default,
58
+ AST_Defun,
59
+ AST_Destructuring,
60
+ AST_Do,
61
+ AST_Exit,
62
+ AST_Expansion,
63
+ AST_For,
64
+ AST_ForIn,
65
+ AST_If,
66
+ AST_LabeledStatement,
67
+ AST_Lambda,
68
+ AST_New,
69
+ AST_Node,
70
+ AST_Number,
71
+ AST_ObjectKeyVal,
72
+ AST_PropAccess,
73
+ AST_Sequence,
74
+ AST_SimpleStatement,
75
+ AST_Symbol,
76
+ AST_SymbolCatch,
77
+ AST_SymbolConst,
78
+ AST_SymbolDefun,
79
+ AST_SymbolFunarg,
80
+ AST_SymbolLambda,
81
+ AST_SymbolRef,
82
+ AST_This,
83
+ AST_Toplevel,
84
+ AST_Try,
85
+ AST_Unary,
86
+ AST_UnaryPrefix,
87
+ AST_Undefined,
88
+ AST_VarDef,
89
+ AST_While,
90
+ AST_Yield,
91
+
92
+ walk,
93
+ walk_body,
94
+
95
+ _INLINE,
96
+ _NOINLINE,
97
+ _PURE
98
+ } from "../ast.js";
99
+ import { HOP, make_node, noop } from "../utils/index.js";
100
+
101
+ import { lazy_op, is_modified } from "./inference.js";
102
+ import { INLINED, clear_flag } from "./compressor-flags.js";
103
+ import { read_property, has_break_or_continue, is_recursive_ref } from "./common.js";
104
+
105
+ // Define the method AST_Node#reduce_vars, which goes through the AST in
106
+ // execution order to perform basic flow analysis
107
+
108
+ function def_reduce_vars(node, func) {
109
+ node.DEFMETHOD("reduce_vars", func);
110
+ }
111
+
112
+ def_reduce_vars(AST_Node, noop);
113
+
114
+ function reset_def(compressor, def) {
115
+ def.assignments = 0;
116
+ def.chained = false;
117
+ def.direct_access = false;
118
+ def.escaped = 0;
119
+ def.recursive_refs = 0;
120
+ def.references = [];
121
+ def.single_use = undefined;
122
+ if (def.scope.pinned()) {
123
+ def.fixed = false;
124
+ } else if (def.orig[0] instanceof AST_SymbolConst || !compressor.exposed(def)) {
125
+ def.fixed = def.init;
126
+ } else {
127
+ def.fixed = false;
128
+ }
129
+ }
130
+
131
+ function reset_variables(tw, compressor, node) {
132
+ node.variables.forEach(function(def) {
133
+ reset_def(compressor, def);
134
+ if (def.fixed === null) {
135
+ tw.defs_to_safe_ids.set(def.id, tw.safe_ids);
136
+ mark(tw, def, true);
137
+ } else if (def.fixed) {
138
+ tw.loop_ids.set(def.id, tw.in_loop);
139
+ mark(tw, def, true);
140
+ }
141
+ });
142
+ }
143
+
144
+ function reset_block_variables(compressor, node) {
145
+ if (node.block_scope) node.block_scope.variables.forEach((def) => {
146
+ reset_def(compressor, def);
147
+ });
148
+ }
149
+
150
+ function push(tw) {
151
+ tw.safe_ids = Object.create(tw.safe_ids);
152
+ }
153
+
154
+ function pop(tw) {
155
+ tw.safe_ids = Object.getPrototypeOf(tw.safe_ids);
156
+ }
157
+
158
+ function mark(tw, def, safe) {
159
+ tw.safe_ids[def.id] = safe;
160
+ }
161
+
162
+ function safe_to_read(tw, def) {
163
+ if (def.single_use == "m") return false;
164
+ if (tw.safe_ids[def.id]) {
165
+ if (def.fixed == null) {
166
+ var orig = def.orig[0];
167
+ if (orig instanceof AST_SymbolFunarg || orig.name == "arguments") return false;
168
+ def.fixed = make_node(AST_Undefined, orig);
169
+ }
170
+ return true;
171
+ }
172
+ return def.fixed instanceof AST_Defun;
173
+ }
174
+
175
+ function safe_to_assign(tw, def, scope, value) {
176
+ if (def.fixed === undefined) return true;
177
+ let def_safe_ids;
178
+ if (def.fixed === null
179
+ && (def_safe_ids = tw.defs_to_safe_ids.get(def.id))
180
+ ) {
181
+ def_safe_ids[def.id] = false;
182
+ tw.defs_to_safe_ids.delete(def.id);
183
+ return true;
184
+ }
185
+ if (!HOP(tw.safe_ids, def.id)) return false;
186
+ if (!safe_to_read(tw, def)) return false;
187
+ if (def.fixed === false) return false;
188
+ if (def.fixed != null && (!value || def.references.length > def.assignments)) return false;
189
+ if (def.fixed instanceof AST_Defun) {
190
+ return value instanceof AST_Node && def.fixed.parent_scope === scope;
191
+ }
192
+ return def.orig.every((sym) => {
193
+ return !(sym instanceof AST_SymbolConst
194
+ || sym instanceof AST_SymbolDefun
195
+ || sym instanceof AST_SymbolLambda);
196
+ });
197
+ }
198
+
199
+ function ref_once(tw, compressor, def) {
200
+ return compressor.option("unused")
201
+ && !def.scope.pinned()
202
+ && def.references.length - def.recursive_refs == 1
203
+ && tw.loop_ids.get(def.id) === tw.in_loop;
204
+ }
205
+
206
+ function is_immutable(value) {
207
+ if (!value) return false;
208
+ return value.is_constant()
209
+ || value instanceof AST_Lambda
210
+ || value instanceof AST_This;
211
+ }
212
+
213
+ // A definition "escapes" when its value can leave the point of use.
214
+ // Example: `a = b || c`
215
+ // In this example, "b" and "c" are escaping, because they're going into "a"
216
+ //
217
+ // def.escaped is != 0 when it escapes.
218
+ //
219
+ // When greater than 1, it means that N chained properties will be read off
220
+ // of that def before an escape occurs. This is useful for evaluating
221
+ // property accesses, where you need to know when to stop.
222
+ function mark_escaped(tw, d, scope, node, value, level = 0, depth = 1) {
223
+ var parent = tw.parent(level);
224
+ if (value) {
225
+ if (value.is_constant()) return;
226
+ if (value instanceof AST_ClassExpression) return;
227
+ }
228
+
229
+ if (
230
+ parent instanceof AST_Assign && (parent.operator === "=" || parent.logical) && node === parent.right
231
+ || parent instanceof AST_Call && (node !== parent.expression || parent instanceof AST_New)
232
+ || parent instanceof AST_Exit && node === parent.value && node.scope !== d.scope
233
+ || parent instanceof AST_VarDef && node === parent.value
234
+ || parent instanceof AST_Yield && node === parent.value && node.scope !== d.scope
235
+ ) {
236
+ if (depth > 1 && !(value && value.is_constant_expression(scope))) depth = 1;
237
+ if (!d.escaped || d.escaped > depth) d.escaped = depth;
238
+ return;
239
+ } else if (
240
+ parent instanceof AST_Array
241
+ || parent instanceof AST_Await
242
+ || parent instanceof AST_Binary && lazy_op.has(parent.operator)
243
+ || parent instanceof AST_Conditional && node !== parent.condition
244
+ || parent instanceof AST_Expansion
245
+ || parent instanceof AST_Sequence && node === parent.tail_node()
246
+ ) {
247
+ mark_escaped(tw, d, scope, parent, parent, level + 1, depth);
248
+ } else if (parent instanceof AST_ObjectKeyVal && node === parent.value) {
249
+ var obj = tw.parent(level + 1);
250
+
251
+ mark_escaped(tw, d, scope, obj, obj, level + 2, depth);
252
+ } else if (parent instanceof AST_PropAccess && node === parent.expression) {
253
+ value = read_property(value, parent.property);
254
+
255
+ mark_escaped(tw, d, scope, parent, value, level + 1, depth + 1);
256
+ if (value) return;
257
+ }
258
+
259
+ if (level > 0) return;
260
+ if (parent instanceof AST_Sequence && node !== parent.tail_node()) return;
261
+ if (parent instanceof AST_SimpleStatement) return;
262
+
263
+ d.direct_access = true;
264
+ }
265
+
266
+ const suppress = node => walk(node, node => {
267
+ if (!(node instanceof AST_Symbol)) return;
268
+ var d = node.definition();
269
+ if (!d) return;
270
+ if (node instanceof AST_SymbolRef) d.references.push(node);
271
+ d.fixed = false;
272
+ });
273
+
274
+ def_reduce_vars(AST_Accessor, function(tw, descend, compressor) {
275
+ push(tw);
276
+ reset_variables(tw, compressor, this);
277
+ descend();
278
+ pop(tw);
279
+ return true;
280
+ });
281
+
282
+ def_reduce_vars(AST_Assign, function(tw, descend, compressor) {
283
+ var node = this;
284
+ if (node.left instanceof AST_Destructuring) {
285
+ suppress(node.left);
286
+ return;
287
+ }
288
+
289
+ const finish_walk = () => {
290
+ if (node.logical) {
291
+ node.left.walk(tw);
292
+
293
+ push(tw);
294
+ node.right.walk(tw);
295
+ pop(tw);
296
+
297
+ return true;
298
+ }
299
+ };
300
+
301
+ var sym = node.left;
302
+ if (!(sym instanceof AST_SymbolRef)) return finish_walk();
303
+
304
+ var def = sym.definition();
305
+ var safe = safe_to_assign(tw, def, sym.scope, node.right);
306
+ def.assignments++;
307
+ if (!safe) return finish_walk();
308
+
309
+ var fixed = def.fixed;
310
+ if (!fixed && node.operator != "=" && !node.logical) return finish_walk();
311
+
312
+ var eq = node.operator == "=";
313
+ var value = eq ? node.right : node;
314
+ if (is_modified(compressor, tw, node, value, 0)) return finish_walk();
315
+
316
+ def.references.push(sym);
317
+
318
+ if (!node.logical) {
319
+ if (!eq) def.chained = true;
320
+
321
+ def.fixed = eq ? function() {
322
+ return node.right;
323
+ } : function() {
324
+ return make_node(AST_Binary, node, {
325
+ operator: node.operator.slice(0, -1),
326
+ left: fixed instanceof AST_Node ? fixed : fixed(),
327
+ right: node.right
328
+ });
329
+ };
330
+ }
331
+
332
+ if (node.logical) {
333
+ mark(tw, def, false);
334
+ push(tw);
335
+ node.right.walk(tw);
336
+ pop(tw);
337
+ return true;
338
+ }
339
+
340
+ mark(tw, def, false);
341
+ node.right.walk(tw);
342
+ mark(tw, def, true);
343
+
344
+ mark_escaped(tw, def, sym.scope, node, value, 0, 1);
345
+
346
+ return true;
347
+ });
348
+
349
+ def_reduce_vars(AST_Binary, function(tw) {
350
+ if (!lazy_op.has(this.operator)) return;
351
+ this.left.walk(tw);
352
+ push(tw);
353
+ this.right.walk(tw);
354
+ pop(tw);
355
+ return true;
356
+ });
357
+
358
+ def_reduce_vars(AST_Block, function(tw, descend, compressor) {
359
+ reset_block_variables(compressor, this);
360
+ });
361
+
362
+ def_reduce_vars(AST_Case, function(tw) {
363
+ push(tw);
364
+ this.expression.walk(tw);
365
+ pop(tw);
366
+ push(tw);
367
+ walk_body(this, tw);
368
+ pop(tw);
369
+ return true;
370
+ });
371
+
372
+ def_reduce_vars(AST_Class, function(tw, descend) {
373
+ clear_flag(this, INLINED);
374
+ push(tw);
375
+ descend();
376
+ pop(tw);
377
+ return true;
378
+ });
379
+
380
+ def_reduce_vars(AST_Conditional, function(tw) {
381
+ this.condition.walk(tw);
382
+ push(tw);
383
+ this.consequent.walk(tw);
384
+ pop(tw);
385
+ push(tw);
386
+ this.alternative.walk(tw);
387
+ pop(tw);
388
+ return true;
389
+ });
390
+
391
+ def_reduce_vars(AST_Chain, function(tw, descend) {
392
+ // Chains' conditions apply left-to-right, cumulatively.
393
+ // If we walk normally we don't go in that order because we would pop before pushing again
394
+ // Solution: AST_PropAccess and AST_Call push when they are optional, and never pop.
395
+ // Then we pop everything when they are done being walked.
396
+ const safe_ids = tw.safe_ids;
397
+
398
+ descend();
399
+
400
+ // Unroll back to start
401
+ tw.safe_ids = safe_ids;
402
+ return true;
403
+ });
404
+
405
+ def_reduce_vars(AST_Call, function (tw) {
406
+ this.expression.walk(tw);
407
+
408
+ if (this.optional) {
409
+ // Never pop -- it's popped at AST_Chain above
410
+ push(tw);
411
+ }
412
+
413
+ for (const arg of this.args) arg.walk(tw);
414
+
415
+ return true;
416
+ });
417
+
418
+ def_reduce_vars(AST_PropAccess, function (tw) {
419
+ if (!this.optional) return;
420
+
421
+ this.expression.walk(tw);
422
+
423
+ // Never pop -- it's popped at AST_Chain above
424
+ push(tw);
425
+
426
+ if (this.property instanceof AST_Node) this.property.walk(tw);
427
+
428
+ return true;
429
+ });
430
+
431
+ def_reduce_vars(AST_Default, function(tw, descend) {
432
+ push(tw);
433
+ descend();
434
+ pop(tw);
435
+ return true;
436
+ });
437
+
438
+ function mark_lambda(tw, descend, compressor) {
439
+ clear_flag(this, INLINED);
440
+ push(tw);
441
+ reset_variables(tw, compressor, this);
442
+ if (this.uses_arguments) {
443
+ descend();
444
+ pop(tw);
445
+ return;
446
+ }
447
+ var iife;
448
+ if (!this.name
449
+ && (iife = tw.parent()) instanceof AST_Call
450
+ && iife.expression === this
451
+ && !iife.args.some(arg => arg instanceof AST_Expansion)
452
+ && this.argnames.every(arg_name => arg_name instanceof AST_Symbol)
453
+ ) {
454
+ // Virtually turn IIFE parameters into variable definitions:
455
+ // (function(a,b) {...})(c,d) => (function() {var a=c,b=d; ...})()
456
+ // So existing transformation rules can work on them.
457
+ this.argnames.forEach((arg, i) => {
458
+ if (!arg.definition) return;
459
+ var d = arg.definition();
460
+ // Avoid setting fixed when there's more than one origin for a variable value
461
+ if (d.orig.length > 1) return;
462
+ if (d.fixed === undefined && (!this.uses_arguments || tw.has_directive("use strict"))) {
463
+ d.fixed = function() {
464
+ return iife.args[i] || make_node(AST_Undefined, iife);
465
+ };
466
+ tw.loop_ids.set(d.id, tw.in_loop);
467
+ mark(tw, d, true);
468
+ } else {
469
+ d.fixed = false;
470
+ }
471
+ });
472
+ }
473
+ descend();
474
+ pop(tw);
475
+ return true;
476
+ }
477
+
478
+ def_reduce_vars(AST_Lambda, mark_lambda);
479
+
480
+ def_reduce_vars(AST_Do, function(tw, descend, compressor) {
481
+ reset_block_variables(compressor, this);
482
+ const saved_loop = tw.in_loop;
483
+ tw.in_loop = this;
484
+ push(tw);
485
+ this.body.walk(tw);
486
+ if (has_break_or_continue(this)) {
487
+ pop(tw);
488
+ push(tw);
489
+ }
490
+ this.condition.walk(tw);
491
+ pop(tw);
492
+ tw.in_loop = saved_loop;
493
+ return true;
494
+ });
495
+
496
+ def_reduce_vars(AST_For, function(tw, descend, compressor) {
497
+ reset_block_variables(compressor, this);
498
+ if (this.init) this.init.walk(tw);
499
+ const saved_loop = tw.in_loop;
500
+ tw.in_loop = this;
501
+ push(tw);
502
+ if (this.condition) this.condition.walk(tw);
503
+ this.body.walk(tw);
504
+ if (this.step) {
505
+ if (has_break_or_continue(this)) {
506
+ pop(tw);
507
+ push(tw);
508
+ }
509
+ this.step.walk(tw);
510
+ }
511
+ pop(tw);
512
+ tw.in_loop = saved_loop;
513
+ return true;
514
+ });
515
+
516
+ def_reduce_vars(AST_ForIn, function(tw, descend, compressor) {
517
+ reset_block_variables(compressor, this);
518
+ suppress(this.init);
519
+ this.object.walk(tw);
520
+ const saved_loop = tw.in_loop;
521
+ tw.in_loop = this;
522
+ push(tw);
523
+ this.body.walk(tw);
524
+ pop(tw);
525
+ tw.in_loop = saved_loop;
526
+ return true;
527
+ });
528
+
529
+ def_reduce_vars(AST_If, function(tw) {
530
+ this.condition.walk(tw);
531
+ push(tw);
532
+ this.body.walk(tw);
533
+ pop(tw);
534
+ if (this.alternative) {
535
+ push(tw);
536
+ this.alternative.walk(tw);
537
+ pop(tw);
538
+ }
539
+ return true;
540
+ });
541
+
542
+ def_reduce_vars(AST_LabeledStatement, function(tw) {
543
+ push(tw);
544
+ this.body.walk(tw);
545
+ pop(tw);
546
+ return true;
547
+ });
548
+
549
+ def_reduce_vars(AST_SymbolCatch, function() {
550
+ this.definition().fixed = false;
551
+ });
552
+
553
+ def_reduce_vars(AST_SymbolRef, function(tw, descend, compressor) {
554
+ var d = this.definition();
555
+ d.references.push(this);
556
+ if (d.references.length == 1
557
+ && !d.fixed
558
+ && d.orig[0] instanceof AST_SymbolDefun) {
559
+ tw.loop_ids.set(d.id, tw.in_loop);
560
+ }
561
+ var fixed_value;
562
+ if (d.fixed === undefined || !safe_to_read(tw, d)) {
563
+ d.fixed = false;
564
+ } else if (d.fixed) {
565
+ fixed_value = this.fixed_value();
566
+ if (
567
+ fixed_value instanceof AST_Lambda
568
+ && is_recursive_ref(tw, d)
569
+ ) {
570
+ d.recursive_refs++;
571
+ } else if (fixed_value
572
+ && !compressor.exposed(d)
573
+ && ref_once(tw, compressor, d)
574
+ ) {
575
+ d.single_use =
576
+ fixed_value instanceof AST_Lambda && !fixed_value.pinned()
577
+ || fixed_value instanceof AST_Class
578
+ || d.scope === this.scope && fixed_value.is_constant_expression();
579
+ } else {
580
+ d.single_use = false;
581
+ }
582
+ if (is_modified(compressor, tw, this, fixed_value, 0, is_immutable(fixed_value))) {
583
+ if (d.single_use) {
584
+ d.single_use = "m";
585
+ } else {
586
+ d.fixed = false;
587
+ }
588
+ }
589
+ }
590
+ mark_escaped(tw, d, this.scope, this, fixed_value, 0, 1);
591
+ });
592
+
593
+ def_reduce_vars(AST_Toplevel, function(tw, descend, compressor) {
594
+ this.globals.forEach(function(def) {
595
+ reset_def(compressor, def);
596
+ });
597
+ reset_variables(tw, compressor, this);
598
+ });
599
+
600
+ def_reduce_vars(AST_Try, function(tw, descend, compressor) {
601
+ reset_block_variables(compressor, this);
602
+ push(tw);
603
+ walk_body(this, tw);
604
+ pop(tw);
605
+ if (this.bcatch) {
606
+ push(tw);
607
+ this.bcatch.walk(tw);
608
+ pop(tw);
609
+ }
610
+ if (this.bfinally) this.bfinally.walk(tw);
611
+ return true;
612
+ });
613
+
614
+ def_reduce_vars(AST_Unary, function(tw) {
615
+ var node = this;
616
+ if (node.operator !== "++" && node.operator !== "--") return;
617
+ var exp = node.expression;
618
+ if (!(exp instanceof AST_SymbolRef)) return;
619
+ var def = exp.definition();
620
+ var safe = safe_to_assign(tw, def, exp.scope, true);
621
+ def.assignments++;
622
+ if (!safe) return;
623
+ var fixed = def.fixed;
624
+ if (!fixed) return;
625
+ def.references.push(exp);
626
+ def.chained = true;
627
+ def.fixed = function() {
628
+ return make_node(AST_Binary, node, {
629
+ operator: node.operator.slice(0, -1),
630
+ left: make_node(AST_UnaryPrefix, node, {
631
+ operator: "+",
632
+ expression: fixed instanceof AST_Node ? fixed : fixed()
633
+ }),
634
+ right: make_node(AST_Number, node, {
635
+ value: 1
636
+ })
637
+ });
638
+ };
639
+ mark(tw, def, true);
640
+ return true;
641
+ });
642
+
643
+ def_reduce_vars(AST_VarDef, function(tw, descend) {
644
+ var node = this;
645
+ if (node.name instanceof AST_Destructuring) {
646
+ suppress(node.name);
647
+ return;
648
+ }
649
+ var d = node.name.definition();
650
+ if (node.value) {
651
+ if (safe_to_assign(tw, d, node.name.scope, node.value)) {
652
+ d.fixed = function() {
653
+ return node.value;
654
+ };
655
+ tw.loop_ids.set(d.id, tw.in_loop);
656
+ mark(tw, d, false);
657
+ descend();
658
+ mark(tw, d, true);
659
+ return true;
660
+ } else {
661
+ d.fixed = false;
662
+ }
663
+ }
664
+ });
665
+
666
+ def_reduce_vars(AST_While, function(tw, descend, compressor) {
667
+ reset_block_variables(compressor, this);
668
+ const saved_loop = tw.in_loop;
669
+ tw.in_loop = this;
670
+ push(tw);
671
+ descend();
672
+ pop(tw);
673
+ tw.in_loop = saved_loop;
674
+ return true;
675
+ });