terser 1.2.6 → 1.2.8

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.
data/lib/terser.js CHANGED
@@ -81,7 +81,7 @@ function defaults(args, defs, croak) {
81
81
  for (const i in defs) if (HOP(defs, i)) {
82
82
  if (!args || !HOP(args, i)) {
83
83
  ret[i] = defs[i];
84
- } else if (i === "ecma") {
84
+ } else if (i === "ecma" || i === "builtins_ecma") {
85
85
  let ecma = args[i] | 0;
86
86
  if (ecma > 5 && ecma < 2015) ecma += 2009;
87
87
  ret[i] = ecma;
@@ -132,6 +132,15 @@ function make_node(ctor, orig, props) {
132
132
  return new ctor(props);
133
133
  }
134
134
 
135
+ /** Makes a `void 0` expression. Use instead of AST_Undefined which may conflict
136
+ * with an existing variable called `undefined` */
137
+ function make_void_0(orig) {
138
+ return make_node(AST_UnaryPrefix, orig, {
139
+ operator: "void",
140
+ expression: make_node(AST_Number, orig, { value: 0 })
141
+ });
142
+ }
143
+
135
144
  function push_uniq(array, el) {
136
145
  if (!array.includes(el))
137
146
  array.push(el);
@@ -268,6 +277,130 @@ function clear_annotation(node, annotation) {
268
277
  node._annotations &= ~annotation;
269
278
  }
270
279
 
280
+ // surrogate safe regexps adapted from https://github.com/mathiasbynens/unicode-8.0.0/tree/89b412d8a71ecca9ed593d9e9fa073ab64acfebe/Binary_Property
281
+ /** Used for checking if a string is an identifier during output.
282
+ * We don't use \p{ID_Start} and \p{ID_Continue} because that's a moving target
283
+ * and Terser's output should run on old browsers.
284
+ */
285
+ var UNICODE_NARROW = {
286
+ ID_Start: /[$A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,
287
+ ID_Continue: /(?:[$0-9A-Z_a-z\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF])+/,
288
+ };
289
+
290
+ /** For detecting and bounding identifiers in source text. Broader than
291
+ * UNICODE_NARROW depending on the JS runtime's unicode version */
292
+ var UNICODE_BROAD = UNICODE_NARROW;
293
+ try {
294
+ UNICODE_BROAD = {
295
+ // https://262.ecma-international.org/13.0/#prod-IdentifierStartChar
296
+ // $, _, ID_Start
297
+ ID_Start: new RegExp("[_$\\p{ID_Start}]", "u"),
298
+ // https://262.ecma-international.org/13.0/#prod-IdentifierPartChar
299
+ // $, zero-width-joiner, zero-width-non-joiner, ID_Continue
300
+ ID_Continue: new RegExp("[$\\u200C\\u200D\\p{ID_Continue}]+", "u"),
301
+ };
302
+ } catch(e) {
303
+ // Could not use modern JS \p{...}.
304
+ }
305
+
306
+ const BASIC_IDENT = /^[a-z_$][a-z0-9_$]*$/i;
307
+
308
+ function is_basic_identifier_string(str) {
309
+ return BASIC_IDENT.test(str);
310
+ }
311
+
312
+ function get_full_char(str, pos) {
313
+ if (is_surrogate_pair_head(str.charCodeAt(pos))) {
314
+ if (is_surrogate_pair_tail(str.charCodeAt(pos + 1))) {
315
+ return str.charAt(pos) + str.charAt(pos + 1);
316
+ }
317
+ } else if (is_surrogate_pair_tail(str.charCodeAt(pos))) {
318
+ if (is_surrogate_pair_head(str.charCodeAt(pos - 1))) {
319
+ return str.charAt(pos - 1) + str.charAt(pos);
320
+ }
321
+ }
322
+ return str.charAt(pos);
323
+ }
324
+
325
+ function get_full_char_code(str, pos) {
326
+ // https://en.wikipedia.org/wiki/Universal_Character_Set_characters#Surrogates
327
+ const char_code = str.charCodeAt(pos);
328
+ if (is_surrogate_pair_head(char_code)) {
329
+ return 0x10000 + (char_code - 0xd800 << 10) + str.charCodeAt(pos + 1) - 0xdc00;
330
+ }
331
+ return char_code;
332
+ }
333
+
334
+ function get_full_char_length(str) {
335
+ var surrogates = 0;
336
+
337
+ for (var i = 0; i < str.length; i++) {
338
+ if (is_surrogate_pair_head(str.charCodeAt(i)) && is_surrogate_pair_tail(str.charCodeAt(i + 1))) {
339
+ surrogates++;
340
+ i++;
341
+ }
342
+ }
343
+
344
+ return str.length - surrogates;
345
+ }
346
+
347
+ function from_char_code(code) {
348
+ // Based on https://github.com/mathiasbynens/String.fromCodePoint/blob/master/fromcodepoint.js
349
+ if (code > 0xFFFF) {
350
+ code -= 0x10000;
351
+ return (String.fromCharCode((code >> 10) + 0xD800) +
352
+ String.fromCharCode((code % 0x400) + 0xDC00));
353
+ }
354
+ return String.fromCharCode(code);
355
+ }
356
+
357
+ function is_surrogate_pair_head(code) {
358
+ return code >= 0xd800 && code <= 0xdbff;
359
+ }
360
+
361
+ function is_surrogate_pair_tail(code) {
362
+ return code >= 0xdc00 && code <= 0xdfff;
363
+ }
364
+
365
+ function is_identifier_start(ch) {
366
+ return UNICODE_NARROW.ID_Start.test(ch);
367
+ }
368
+
369
+ function is_identifier_char(ch) {
370
+ return UNICODE_NARROW.ID_Continue.test(ch);
371
+ }
372
+
373
+ /** supports a "wider" range of identifiers -- as unicode evolves, new characters are accepted */
374
+ function is_identifier_start_broad(ch) {
375
+ return UNICODE_BROAD.ID_Start.test(ch);
376
+ }
377
+
378
+ /** supports a "wider" range of identifiers -- as unicode evolves, new characters are accepted */
379
+ function is_identifier_char_broad(ch) {
380
+ return UNICODE_BROAD.ID_Continue.test(ch);
381
+ }
382
+
383
+ function is_identifier_string(str, allow_surrogates) {
384
+ if (BASIC_IDENT.test(str)) {
385
+ return true;
386
+ }
387
+ if (!allow_surrogates && /[\ud800-\udfff]/.test(str)) {
388
+ return false;
389
+ }
390
+ var match = UNICODE_NARROW.ID_Start.exec(str);
391
+ if (!match || match.index !== 0) {
392
+ return false;
393
+ }
394
+
395
+ str = str.slice(match[0].length);
396
+ if (!str) {
397
+ return true;
398
+ }
399
+
400
+ match = UNICODE_NARROW.ID_Continue.exec(str);
401
+ return !!match && match[0].length === str.length;
402
+ }
403
+
271
404
  /***********************************************************************
272
405
 
273
406
  A JavaScript tokenizer / parser / beautifier / compressor.
@@ -336,6 +469,8 @@ var RE_BIN_NUMBER = /^0b[01]+$/i;
336
469
  var RE_DEC_NUMBER = /^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i;
337
470
  var RE_BIG_INT = /^(0[xob])?[0-9a-f]+n$/i;
338
471
 
472
+ var RE_KEYWORD_RELATIONAL_OPERATORS = /in(?:stanceof)?/y;
473
+
339
474
  var OPERATORS = makePredicate([
340
475
  "in",
341
476
  "instanceof",
@@ -401,103 +536,10 @@ var PUNC_CHARS = makePredicate(characters("[]{}(),;:"));
401
536
 
402
537
  /* -----[ Tokenizer ]----- */
403
538
 
404
- // surrogate safe regexps adapted from https://github.com/mathiasbynens/unicode-8.0.0/tree/89b412d8a71ecca9ed593d9e9fa073ab64acfebe/Binary_Property
405
- var UNICODE = {
406
- ID_Start: /[$A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,
407
- ID_Continue: /(?:[$0-9A-Z_a-z\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF])+/,
408
- };
409
-
410
- function get_full_char(str, pos) {
411
- if (is_surrogate_pair_head(str.charCodeAt(pos))) {
412
- if (is_surrogate_pair_tail(str.charCodeAt(pos + 1))) {
413
- return str.charAt(pos) + str.charAt(pos + 1);
414
- }
415
- } else if (is_surrogate_pair_tail(str.charCodeAt(pos))) {
416
- if (is_surrogate_pair_head(str.charCodeAt(pos - 1))) {
417
- return str.charAt(pos - 1) + str.charAt(pos);
418
- }
419
- }
420
- return str.charAt(pos);
421
- }
422
-
423
- function get_full_char_code(str, pos) {
424
- // https://en.wikipedia.org/wiki/Universal_Character_Set_characters#Surrogates
425
- if (is_surrogate_pair_head(str.charCodeAt(pos))) {
426
- return 0x10000 + (str.charCodeAt(pos) - 0xd800 << 10) + str.charCodeAt(pos + 1) - 0xdc00;
427
- }
428
- return str.charCodeAt(pos);
429
- }
430
-
431
- function get_full_char_length(str) {
432
- var surrogates = 0;
433
-
434
- for (var i = 0; i < str.length; i++) {
435
- if (is_surrogate_pair_head(str.charCodeAt(i)) && is_surrogate_pair_tail(str.charCodeAt(i + 1))) {
436
- surrogates++;
437
- i++;
438
- }
439
- }
440
-
441
- return str.length - surrogates;
442
- }
443
-
444
- function from_char_code(code) {
445
- // Based on https://github.com/mathiasbynens/String.fromCodePoint/blob/master/fromcodepoint.js
446
- if (code > 0xFFFF) {
447
- code -= 0x10000;
448
- return (String.fromCharCode((code >> 10) + 0xD800) +
449
- String.fromCharCode((code % 0x400) + 0xDC00));
450
- }
451
- return String.fromCharCode(code);
452
- }
453
-
454
- function is_surrogate_pair_head(code) {
455
- return code >= 0xd800 && code <= 0xdbff;
456
- }
457
-
458
- function is_surrogate_pair_tail(code) {
459
- return code >= 0xdc00 && code <= 0xdfff;
460
- }
461
-
462
539
  function is_digit(code) {
463
540
  return code >= 48 && code <= 57;
464
541
  }
465
542
 
466
- function is_identifier_start(ch) {
467
- return UNICODE.ID_Start.test(ch);
468
- }
469
-
470
- function is_identifier_char(ch) {
471
- return UNICODE.ID_Continue.test(ch);
472
- }
473
-
474
- const BASIC_IDENT = /^[a-z_$][a-z0-9_$]*$/i;
475
-
476
- function is_basic_identifier_string(str) {
477
- return BASIC_IDENT.test(str);
478
- }
479
-
480
- function is_identifier_string(str, allow_surrogates) {
481
- if (BASIC_IDENT.test(str)) {
482
- return true;
483
- }
484
- if (!allow_surrogates && /[\ud800-\udfff]/.test(str)) {
485
- return false;
486
- }
487
- var match = UNICODE.ID_Start.exec(str);
488
- if (!match || match.index !== 0) {
489
- return false;
490
- }
491
-
492
- str = str.slice(match[0].length);
493
- if (!str) {
494
- return true;
495
- }
496
-
497
- match = UNICODE.ID_Continue.exec(str);
498
- return !!match && match[0].length === str.length;
499
- }
500
-
501
543
  function parse_js_number(num, allow_e = true) {
502
544
  if (!allow_e && num.includes("e")) {
503
545
  return NaN;
@@ -660,6 +702,56 @@ function tokenizer($TEXT, filename, html5_comments, shebang) {
660
702
  next();
661
703
  }
662
704
 
705
+ function peek_next_token_start_or_newline() {
706
+ var pos = S.pos;
707
+ for (var in_multiline_comment = false; pos < S.text.length; ) {
708
+ var ch = get_full_char(S.text, pos);
709
+ if (NEWLINE_CHARS.has(ch)) {
710
+ return { char: ch, pos: pos };
711
+ } else if (in_multiline_comment) {
712
+ if (ch == "*" && get_full_char(S.text, pos + 1) == "/") {
713
+ pos += 2;
714
+ in_multiline_comment = false;
715
+ } else {
716
+ pos++;
717
+ }
718
+ } else if (!WHITESPACE_CHARS.has(ch)) {
719
+ if (ch == "/") {
720
+ var next_ch = get_full_char(S.text, pos + 1);
721
+ if (next_ch == "/") {
722
+ pos = find_eol();
723
+ return { char: get_full_char(S.text, pos), pos: pos };
724
+ } else if (next_ch == "*") {
725
+ in_multiline_comment = true;
726
+ pos += 2;
727
+ continue;
728
+ }
729
+ }
730
+ return { char: ch, pos: pos };
731
+ } else {
732
+ pos++;
733
+ }
734
+ }
735
+ return { char: null, pos: pos };
736
+ }
737
+
738
+ function ch_starts_binding_identifier(ch, pos) {
739
+ if (ch == "\\") {
740
+ return true;
741
+ } else if (is_identifier_start_broad(ch)) {
742
+ RE_KEYWORD_RELATIONAL_OPERATORS.lastIndex = pos;
743
+ if (RE_KEYWORD_RELATIONAL_OPERATORS.test(S.text)) {
744
+ var after = get_full_char(S.text, RE_KEYWORD_RELATIONAL_OPERATORS.lastIndex);
745
+ if (!is_identifier_char_broad(after) && after != "\\") {
746
+ // "in" or "instanceof" are keywords, not binding identifiers
747
+ return false;
748
+ }
749
+ }
750
+ return true;
751
+ }
752
+ return false;
753
+ }
754
+
663
755
  function read_while(pred) {
664
756
  var ret = "", ch, i = 0;
665
757
  while ((ch = peek()) && pred(ch, i++))
@@ -902,7 +994,8 @@ function tokenizer($TEXT, filename, html5_comments, shebang) {
902
994
  && (ch >= "a" && ch <= "z" || ch >= "A" && ch <= "Z")
903
995
  );
904
996
 
905
- if (end > start + 1 && ch && ch !== "\\" && !is_identifier_char(ch)) {
997
+ // 0x7F is very rare in actual code, so we compare it to "~" (0x7E)
998
+ if (end > start + 1 && ch && ch !== "\\" && !is_identifier_char_broad(ch) && ch <= "~") {
906
999
  S.pos += end - start;
907
1000
  S.col += end - start;
908
1001
  return S.text.slice(start, S.pos);
@@ -925,10 +1018,10 @@ function tokenizer($TEXT, filename, html5_comments, shebang) {
925
1018
  // Read first character (ID_Start)
926
1019
  if ((ch = peek()) === "\\") {
927
1020
  ch = read_escaped_identifier_char();
928
- if (!is_identifier_start(ch)) {
1021
+ if (!is_identifier_start_broad(ch)) {
929
1022
  parse_error("First identifier char is an invalid identifier char");
930
1023
  }
931
- } else if (is_identifier_start(ch)) {
1024
+ } else if (is_identifier_start_broad(ch)) {
932
1025
  next();
933
1026
  } else {
934
1027
  return "";
@@ -940,11 +1033,11 @@ function tokenizer($TEXT, filename, html5_comments, shebang) {
940
1033
  while ((ch = peek()) != null) {
941
1034
  if ((ch = peek()) === "\\") {
942
1035
  ch = read_escaped_identifier_char();
943
- if (!is_identifier_char(ch)) {
1036
+ if (!is_identifier_char_broad(ch)) {
944
1037
  parse_error("Invalid escaped identifier char");
945
1038
  }
946
1039
  } else {
947
- if (!is_identifier_char(ch)) {
1040
+ if (!is_identifier_char_broad(ch)) {
948
1041
  break;
949
1042
  }
950
1043
  next();
@@ -1120,7 +1213,7 @@ function tokenizer($TEXT, filename, html5_comments, shebang) {
1120
1213
  if (is_digit(code)) return read_num();
1121
1214
  if (PUNC_CHARS.has(ch)) return token("punc", next());
1122
1215
  if (OPERATOR_CHARS.has(ch)) return read_operator();
1123
- if (code == 92 || is_identifier_start(ch)) return read_word();
1216
+ if (code == 92 || is_identifier_start_broad(ch)) return read_word();
1124
1217
  if (code == 35) return read_private_word();
1125
1218
  break;
1126
1219
  }
@@ -1163,6 +1256,9 @@ function tokenizer($TEXT, filename, html5_comments, shebang) {
1163
1256
  return S.directives[directive] > 0;
1164
1257
  };
1165
1258
 
1259
+ next_token.peek_next_token_start_or_newline = peek_next_token_start_or_newline;
1260
+ next_token.ch_starts_binding_identifier = ch_starts_binding_identifier;
1261
+
1166
1262
  return next_token;
1167
1263
 
1168
1264
  }
@@ -1384,10 +1480,6 @@ function parse($TEXT, options) {
1384
1480
  return simple_statement();
1385
1481
 
1386
1482
  case "name":
1387
- case "privatename":
1388
- if(is("privatename") && !S.in_class)
1389
- croak("Private field must be used in an enclosing class");
1390
-
1391
1483
  if (S.token.value == "async" && is_token(peek(), "keyword", "function")) {
1392
1484
  next();
1393
1485
  next();
@@ -1402,10 +1494,31 @@ function parse($TEXT, options) {
1402
1494
  semicolon();
1403
1495
  return node;
1404
1496
  }
1497
+ if (S.token.value == "using" && is_token(peek(), "name") && !has_newline_before(peek())) {
1498
+ next();
1499
+ var node = using_();
1500
+ semicolon();
1501
+ return node;
1502
+ }
1503
+ if (S.token.value == "await" && can_await() && is_token(peek(), "name", "using") && !has_newline_before(peek())) {
1504
+ var next_next = S.input.peek_next_token_start_or_newline();
1505
+ if (S.input.ch_starts_binding_identifier(next_next.char, next_next.pos)) {
1506
+ next();
1507
+ // The "using" token will be consumed by the await_using_ function.
1508
+ var node = await_using_();
1509
+ semicolon();
1510
+ return node;
1511
+ }
1512
+ }
1405
1513
  return is_token(peek(), "punc", ":")
1406
1514
  ? labeled_statement()
1407
1515
  : simple_statement();
1408
1516
 
1517
+ case "privatename":
1518
+ if(!S.in_class)
1519
+ croak("Private field must be used in an enclosing class");
1520
+ return simple_statement();
1521
+
1409
1522
  case "punc":
1410
1523
  switch (S.token.value) {
1411
1524
  case "{":
@@ -1630,6 +1743,8 @@ function parse($TEXT, options) {
1630
1743
  is("keyword", "var") ? (next(), var_(true)) :
1631
1744
  is("keyword", "let") ? (next(), let_(true)) :
1632
1745
  is("keyword", "const") ? (next(), const_(true)) :
1746
+ is("name", "using") && is_token(peek(), "name") && (peek().value != "of" || S.input.peek_next_token_start_or_newline().char == "=") ? (next(), using_(true)) :
1747
+ is("name", "await") && can_await() && is_token(peek(), "name", "using") ? (next(), await_using_(true)) :
1633
1748
  expression(true, true);
1634
1749
  var is_in = is("operator", "in");
1635
1750
  var is_of = is("name", "of");
@@ -1637,9 +1752,12 @@ function parse($TEXT, options) {
1637
1752
  token_error(await_tok, for_await_error);
1638
1753
  }
1639
1754
  if (is_in || is_of) {
1640
- if (init instanceof AST_Definitions) {
1755
+ if (init instanceof AST_DefinitionsLike) {
1641
1756
  if (init.definitions.length > 1)
1642
1757
  token_error(init.start, "Only one variable declaration allowed in for..in loop");
1758
+ if (is_in && init instanceof AST_Using) {
1759
+ token_error(init.start, "Invalid using declaration in for..in loop");
1760
+ }
1643
1761
  } else if (!(is_assignable(init) || (init = to_destructuring(init)) instanceof AST_Destructuring)) {
1644
1762
  token_error(init.start, "Invalid left-hand side in for..in loop");
1645
1763
  }
@@ -1671,7 +1789,7 @@ function parse($TEXT, options) {
1671
1789
  }
1672
1790
 
1673
1791
  function for_of(init, is_await) {
1674
- var lhs = init instanceof AST_Definitions ? init.definitions[0].name : null;
1792
+ var lhs = init instanceof AST_DefinitionsLike ? init.definitions[0].name : null;
1675
1793
  var obj = expression(true);
1676
1794
  expect(")");
1677
1795
  return new AST_ForOf({
@@ -2267,23 +2385,26 @@ function parse($TEXT, options) {
2267
2385
  var sym_type =
2268
2386
  kind === "var" ? AST_SymbolVar :
2269
2387
  kind === "const" ? AST_SymbolConst :
2270
- kind === "let" ? AST_SymbolLet : null;
2388
+ kind === "let" ? AST_SymbolLet :
2389
+ kind === "using" ? AST_SymbolUsing :
2390
+ kind === "await using" ? AST_SymbolUsing : null;
2391
+ var def_type = kind === "using" || kind === "await using" ? AST_UsingDef : AST_VarDef;
2271
2392
  // var { a } = b
2272
2393
  if (is("punc", "{") || is("punc", "[")) {
2273
- def = new AST_VarDef({
2394
+ def = new def_type({
2274
2395
  start: S.token,
2275
2396
  name: binding_element(undefined, sym_type),
2276
2397
  value: is("operator", "=") ? (expect_token("operator", "="), expression(false, no_in)) : null,
2277
2398
  end: prev()
2278
2399
  });
2279
2400
  } else {
2280
- def = new AST_VarDef({
2401
+ def = new def_type({
2281
2402
  start : S.token,
2282
2403
  name : as_symbol(sym_type),
2283
2404
  value : is("operator", "=")
2284
2405
  ? (next(), expression(false, no_in))
2285
- : !no_in && kind === "const"
2286
- ? croak("Missing initializer in const declaration") : null,
2406
+ : !no_in && (kind === "const" || kind === "using" || kind === "await using")
2407
+ ? croak("Missing initializer in " + kind + " declaration") : null,
2287
2408
  end : prev()
2288
2409
  });
2289
2410
  if (def.name.name == "import") croak("Unexpected token: import");
@@ -2320,6 +2441,25 @@ function parse($TEXT, options) {
2320
2441
  });
2321
2442
  };
2322
2443
 
2444
+ var using_ = function(no_in) {
2445
+ return new AST_Using({
2446
+ start : prev(),
2447
+ await : false,
2448
+ definitions : vardefs(no_in, "using"),
2449
+ end : prev()
2450
+ });
2451
+ };
2452
+
2453
+ var await_using_ = function(no_in) {
2454
+ // Assumption: When await_using_ is called, only the `await` token has been consumed.
2455
+ return new AST_Using({
2456
+ start : prev(),
2457
+ await : true,
2458
+ definitions : (next(), vardefs(no_in, "await using")),
2459
+ end : prev()
2460
+ });
2461
+ };
2462
+
2323
2463
  var new_ = function(allow_calls) {
2324
2464
  var start = S.token;
2325
2465
  expect_token("operator", "new");
@@ -2355,12 +2495,20 @@ function parse($TEXT, options) {
2355
2495
  ret = _make_symbol(AST_SymbolRef);
2356
2496
  break;
2357
2497
  case "num":
2358
- ret = new AST_Number({
2359
- start: tok,
2360
- end: tok,
2361
- value: tok.value,
2362
- raw: LATEST_RAW
2363
- });
2498
+ if (tok.value === Infinity) {
2499
+ // very large float values are parsed as Infinity
2500
+ ret = new AST_Infinity({
2501
+ start: tok,
2502
+ end: tok,
2503
+ });
2504
+ } else {
2505
+ ret = new AST_Number({
2506
+ start: tok,
2507
+ end: tok,
2508
+ value: tok.value,
2509
+ raw: LATEST_RAW
2510
+ });
2511
+ }
2364
2512
  break;
2365
2513
  case "big_int":
2366
2514
  ret = new AST_BigInt({
@@ -2461,7 +2609,7 @@ function parse($TEXT, options) {
2461
2609
  return new_(allow_calls);
2462
2610
  }
2463
2611
  if (is("name", "import") && is_token(peek(), "punc", ".")) {
2464
- return import_meta(allow_calls);
2612
+ return parse_import_expr(allow_calls);
2465
2613
  }
2466
2614
  var start = S.token;
2467
2615
  var peeked;
@@ -2738,13 +2886,13 @@ function parse($TEXT, options) {
2738
2886
  return name;
2739
2887
  };
2740
2888
 
2889
+ var is_private = prev().type === "privatename";
2741
2890
  const is_not_method_start = () =>
2742
- !is("punc", "(") && !is("punc", ",") && !is("punc", "}") && !is("punc", ";") && !is("operator", "=");
2891
+ !is("punc", "(") && !is("punc", ",") && !is("punc", "}") && !is("punc", ";") && !is("operator", "=") && !is_private;
2743
2892
 
2744
2893
  var is_async = false;
2745
2894
  var is_static = false;
2746
2895
  var is_generator = false;
2747
- var is_private = false;
2748
2896
  var accessor_type = null;
2749
2897
 
2750
2898
  if (is_class && name === "static" && is_not_method_start()) {
@@ -2767,7 +2915,7 @@ function parse($TEXT, options) {
2767
2915
  accessor_type = name;
2768
2916
  name = as_property_name();
2769
2917
  }
2770
- if (prev().type === "privatename") {
2918
+ if (!is_private && prev().type === "privatename") {
2771
2919
  is_private = true;
2772
2920
  }
2773
2921
 
@@ -2901,6 +3049,17 @@ function parse($TEXT, options) {
2901
3049
  function import_statement() {
2902
3050
  var start = prev();
2903
3051
 
3052
+ // import source x from "..."
3053
+ // import defer * as x from "..."
3054
+ var phase = null;
3055
+ if (is("name", "source") || is("name", "defer")) {
3056
+ var peeked = peek();
3057
+ if (!is_token(peeked, "name", "from") && !is_token(peeked, "punc", ",")) {
3058
+ phase = S.token.value;
3059
+ next();
3060
+ }
3061
+ }
3062
+
2904
3063
  var imported_name;
2905
3064
  var imported_names;
2906
3065
  if (is("name")) {
@@ -2935,14 +3094,33 @@ function parse($TEXT, options) {
2935
3094
  end: mod_str,
2936
3095
  }),
2937
3096
  attributes,
3097
+ phase,
2938
3098
  end: S.token,
2939
3099
  });
2940
3100
  }
2941
3101
 
2942
- function import_meta(allow_calls) {
3102
+ // import.meta
3103
+ // import.source("module")
3104
+ // import.defer("module")
3105
+ function parse_import_expr(allow_calls) {
2943
3106
  var start = S.token;
2944
3107
  expect_token("name", "import");
2945
3108
  expect_token("punc", ".");
3109
+ if (is("name", "source") || is("name", "defer")) {
3110
+ var phase = S.token.value;
3111
+ next();
3112
+ if (!is("punc", "(")) {
3113
+ croak("'import." + phase + "' can only be used in a dynamic import");
3114
+ }
3115
+ next();
3116
+ var args = expr_list(")");
3117
+ return subscripts(new AST_DynamicImport({
3118
+ start: start,
3119
+ phase: phase,
3120
+ args: args,
3121
+ end: prev()
3122
+ }), allow_calls);
3123
+ }
2946
3124
  expect_token("name", "meta");
2947
3125
  return subscripts(new AST_ImportMeta({
2948
3126
  start: start,
@@ -4995,7 +5173,7 @@ var AST_Finally = DEFNODE("Finally", null, function AST_Finally(props) {
4995
5173
 
4996
5174
  /* -----[ VAR/CONST ]----- */
4997
5175
 
4998
- var AST_Definitions = DEFNODE("Definitions", "definitions", function AST_Definitions(props) {
5176
+ var AST_DefinitionsLike = DEFNODE("DefinitionsLike", "definitions", function AST_DefinitionsLike(props) {
4999
5177
  if (props) {
5000
5178
  this.definitions = props.definitions;
5001
5179
  this.start = props.start;
@@ -5004,9 +5182,9 @@ var AST_Definitions = DEFNODE("Definitions", "definitions", function AST_Definit
5004
5182
 
5005
5183
  this.flags = 0;
5006
5184
  }, {
5007
- $documentation: "Base class for `var` or `const` nodes (variable declarations/initializations)",
5185
+ $documentation: "Base class for variable definitions and `using`",
5008
5186
  $propdoc: {
5009
- definitions: "[AST_VarDef*] array of variable definitions"
5187
+ definitions: "[AST_VarDef*|AST_UsingDef*] array of variable definitions"
5010
5188
  },
5011
5189
  _walk: function(visitor) {
5012
5190
  return visitor._visit(this, function() {
@@ -5022,6 +5200,18 @@ var AST_Definitions = DEFNODE("Definitions", "definitions", function AST_Definit
5022
5200
  },
5023
5201
  }, AST_Statement);
5024
5202
 
5203
+ var AST_Definitions = DEFNODE("Definitions", null, function AST_Definitions(props) {
5204
+ if (props) {
5205
+ this.definitions = props.definitions;
5206
+ this.start = props.start;
5207
+ this.end = props.end;
5208
+ }
5209
+
5210
+ this.flags = 0;
5211
+ }, {
5212
+ $documentation: "Base class for `var` or `const` nodes (variable declarations/initializations)",
5213
+ }, AST_DefinitionsLike);
5214
+
5025
5215
  var AST_Var = DEFNODE("Var", null, function AST_Var(props) {
5026
5216
  if (props) {
5027
5217
  this.definitions = props.definitions;
@@ -5058,7 +5248,23 @@ var AST_Const = DEFNODE("Const", null, function AST_Const(props) {
5058
5248
  $documentation: "A `const` statement"
5059
5249
  }, AST_Definitions);
5060
5250
 
5061
- var AST_VarDef = DEFNODE("VarDef", "name value", function AST_VarDef(props) {
5251
+ var AST_Using = DEFNODE("Using", "await", function AST_Using(props) {
5252
+ if (props) {
5253
+ this.await = props.await;
5254
+ this.definitions = props.definitions;
5255
+ this.start = props.start;
5256
+ this.end = props.end;
5257
+ }
5258
+
5259
+ this.flags = 0;
5260
+ }, {
5261
+ $documentation: "A `using` statement",
5262
+ $propdoc: {
5263
+ await: "[boolean] Whether it's `await using`"
5264
+ },
5265
+ }, AST_DefinitionsLike);
5266
+
5267
+ var AST_VarDefLike = DEFNODE("VarDefLike", "name value", function AST_VarDefLike(props) {
5062
5268
  if (props) {
5063
5269
  this.name = props.name;
5064
5270
  this.value = props.value;
@@ -5068,9 +5274,9 @@ var AST_VarDef = DEFNODE("VarDef", "name value", function AST_VarDef(props) {
5068
5274
 
5069
5275
  this.flags = 0;
5070
5276
  }, {
5071
- $documentation: "A variable declaration; only appears in a AST_Definitions node",
5277
+ $documentation: "A name=value pair in a variable definition statement or `using`",
5072
5278
  $propdoc: {
5073
- name: "[AST_Destructuring|AST_SymbolConst|AST_SymbolLet|AST_SymbolVar] name of the variable",
5279
+ name: "[AST_Destructuring|AST_SymbolDeclaration] name of the variable",
5074
5280
  value: "[AST_Node?] initializer, or null of there's no initializer"
5075
5281
  },
5076
5282
  _walk: function(visitor) {
@@ -5085,13 +5291,39 @@ var AST_VarDef = DEFNODE("VarDef", "name value", function AST_VarDef(props) {
5085
5291
  },
5086
5292
  declarations_as_names() {
5087
5293
  if (this.name instanceof AST_SymbolDeclaration) {
5088
- return [this];
5294
+ return [this.name];
5089
5295
  } else {
5090
5296
  return this.name.all_symbols();
5091
5297
  }
5092
5298
  }
5093
5299
  });
5094
5300
 
5301
+ var AST_VarDef = DEFNODE("VarDef", null, function AST_VarDef(props) {
5302
+ if (props) {
5303
+ this.name = props.name;
5304
+ this.value = props.value;
5305
+ this.start = props.start;
5306
+ this.end = props.end;
5307
+ }
5308
+
5309
+ this.flags = 0;
5310
+ }, {
5311
+ $documentation: "A variable declaration; only appears in a AST_Definitions node",
5312
+ }, AST_VarDefLike);
5313
+
5314
+ var AST_UsingDef = DEFNODE("UsingDef", null, function AST_UsingDef(props) {
5315
+ if (props) {
5316
+ this.name = props.name;
5317
+ this.value = props.value;
5318
+ this.start = props.start;
5319
+ this.end = props.end;
5320
+ }
5321
+
5322
+ this.flags = 0;
5323
+ }, {
5324
+ $documentation: "Like VarDef but specific to AST_Using",
5325
+ }, AST_VarDefLike);
5326
+
5095
5327
  var AST_NameMapping = DEFNODE("NameMapping", "foreign_name name", function AST_NameMapping(props) {
5096
5328
  if (props) {
5097
5329
  this.foreign_name = props.foreign_name;
@@ -5121,9 +5353,10 @@ var AST_NameMapping = DEFNODE("NameMapping", "foreign_name name", function AST_N
5121
5353
 
5122
5354
  var AST_Import = DEFNODE(
5123
5355
  "Import",
5124
- "imported_name imported_names module_name attributes",
5356
+ "phase imported_name imported_names module_name attributes",
5125
5357
  function AST_Import(props) {
5126
5358
  if (props) {
5359
+ this.phase = props.phase;
5127
5360
  this.imported_name = props.imported_name;
5128
5361
  this.imported_names = props.imported_names;
5129
5362
  this.module_name = props.module_name;
@@ -5137,6 +5370,7 @@ var AST_Import = DEFNODE(
5137
5370
  {
5138
5371
  $documentation: "An `import` statement",
5139
5372
  $propdoc: {
5373
+ phase: "[string?] Phase keyword: 'source', 'defer', or null.",
5140
5374
  imported_name: "[AST_SymbolImport] The name of the variable holding the module's default export.",
5141
5375
  imported_names: "[AST_NameMapping*] The names of non-default imported variables",
5142
5376
  module_name: "[AST_String] String literal describing where this module came from",
@@ -5177,6 +5411,40 @@ var AST_ImportMeta = DEFNODE("ImportMeta", null, function AST_ImportMeta(props)
5177
5411
  $documentation: "A reference to import.meta",
5178
5412
  });
5179
5413
 
5414
+ var AST_DynamicImport = DEFNODE(
5415
+ "DynamicImport",
5416
+ "phase args",
5417
+ function AST_DynamicImport(props) {
5418
+ if (props) {
5419
+ this.phase = props.phase;
5420
+ this.args = props.args;
5421
+ this.start = props.start;
5422
+ this.end = props.end;
5423
+ }
5424
+
5425
+ this.flags = 0;
5426
+ },
5427
+ {
5428
+ $documentation: "A phased dynamic import expression: `import.source(specifier [, options])` or `import.defer(specifier [, options])`. Plain `import(x)` continues to be parsed as an AST_Call with a synthetic `import` SymbolRef callee.",
5429
+ $propdoc: {
5430
+ phase: "[string] Phase keyword ('source' or 'defer').",
5431
+ args: "[AST_Node*] specifier followed by optional options argument"
5432
+ },
5433
+ _walk: function(visitor) {
5434
+ return visitor._visit(this, function() {
5435
+ var args = this.args;
5436
+ for (var i = 0, len = args.length; i < len; i++) {
5437
+ args[i]._walk(visitor);
5438
+ }
5439
+ });
5440
+ },
5441
+ _children_backwards(push) {
5442
+ let i = this.args.length;
5443
+ while (i--) push(this.args[i]);
5444
+ },
5445
+ }
5446
+ );
5447
+
5180
5448
  var AST_Export = DEFNODE(
5181
5449
  "Export",
5182
5450
  "exported_definition exported_value is_default exported_names module_name attributes",
@@ -6187,6 +6455,21 @@ var AST_SymbolConst = DEFNODE("SymbolConst", null, function AST_SymbolConst(prop
6187
6455
  $documentation: "A constant declaration"
6188
6456
  }, AST_SymbolBlockDeclaration);
6189
6457
 
6458
+ var AST_SymbolUsing = DEFNODE("SymbolUsing", null, function AST_SymbolUsing(props) {
6459
+ if (props) {
6460
+ this.init = props.init;
6461
+ this.scope = props.scope;
6462
+ this.name = props.name;
6463
+ this.thedef = props.thedef;
6464
+ this.start = props.start;
6465
+ this.end = props.end;
6466
+ }
6467
+
6468
+ this.flags = 0;
6469
+ }, {
6470
+ $documentation: "A `using` declaration"
6471
+ }, AST_SymbolBlockDeclaration);
6472
+
6190
6473
  var AST_SymbolLet = DEFNODE("SymbolLet", null, function AST_SymbolLet(props) {
6191
6474
  if (props) {
6192
6475
  this.init = props.init;
@@ -7032,11 +7315,11 @@ def_transform(AST_Catch, function(self, tw) {
7032
7315
  self.body = MAP(self.body, tw);
7033
7316
  });
7034
7317
 
7035
- def_transform(AST_Definitions, function(self, tw) {
7318
+ def_transform(AST_DefinitionsLike, function(self, tw) {
7036
7319
  self.definitions = MAP(self.definitions, tw);
7037
7320
  });
7038
7321
 
7039
- def_transform(AST_VarDef, function(self, tw) {
7322
+ def_transform(AST_VarDefLike, function(self, tw) {
7040
7323
  self.name = self.name.transform(tw);
7041
7324
  if (self.value) self.value = self.value.transform(tw);
7042
7325
  });
@@ -7570,19 +7853,30 @@ def_transform(AST_PrefixedTemplateString, function(self, tw) {
7570
7853
 
7571
7854
  VariableDeclaration: function(M) {
7572
7855
  let decl_type;
7856
+ let defs_type = AST_VarDef;
7573
7857
  let sym_type;
7858
+ let await_using = false;
7574
7859
  if (M.kind === "const") {
7575
7860
  decl_type = AST_Const;
7576
7861
  sym_type = AST_SymbolConst;
7577
7862
  } else if (M.kind === "let") {
7578
7863
  decl_type = AST_Let;
7579
7864
  sym_type = AST_SymbolLet;
7865
+ } else if (M.kind === "using") {
7866
+ decl_type = AST_Using;
7867
+ defs_type = AST_UsingDef;
7868
+ sym_type = AST_SymbolUsing;
7869
+ } else if (M.kind === "await using") {
7870
+ decl_type = AST_Using;
7871
+ defs_type = AST_UsingDef;
7872
+ sym_type = AST_SymbolUsing;
7873
+ await_using = true;
7580
7874
  } else {
7581
7875
  decl_type = AST_Var;
7582
7876
  sym_type = AST_SymbolVar;
7583
7877
  }
7584
7878
  const definitions = M.declarations.map(M => {
7585
- return new AST_VarDef({
7879
+ return new defs_type({
7586
7880
  start: my_start_token(M),
7587
7881
  end: my_end_token(M),
7588
7882
  name: from_moz_pattern(M.id, sym_type),
@@ -7593,6 +7887,7 @@ def_transform(AST_PrefixedTemplateString, function(self, tw) {
7593
7887
  start : my_start_token(M),
7594
7888
  end : my_end_token(M),
7595
7889
  definitions : definitions,
7890
+ await : await_using,
7596
7891
  });
7597
7892
  },
7598
7893
 
@@ -7613,7 +7908,8 @@ def_transform(AST_PrefixedTemplateString, function(self, tw) {
7613
7908
  imported_name: imported_name,
7614
7909
  imported_names : imported_names,
7615
7910
  module_name : from_moz(M.source),
7616
- attributes: import_attributes_from_moz(M.attributes || M.assertions)
7911
+ attributes: import_attributes_from_moz(M.attributes || M.assertions),
7912
+ phase: M.phase || null
7617
7913
  });
7618
7914
  },
7619
7915
 
@@ -7644,6 +7940,14 @@ def_transform(AST_PrefixedTemplateString, function(self, tw) {
7644
7940
  if (M.options) {
7645
7941
  args.push(from_moz(M.options));
7646
7942
  }
7943
+ if (M.phase) {
7944
+ return new AST_DynamicImport({
7945
+ start: my_start_token(M),
7946
+ end: my_end_token(M),
7947
+ phase: M.phase,
7948
+ args: args
7949
+ });
7950
+ }
7647
7951
  return new AST_Call({
7648
7952
  start: my_start_token(M),
7649
7953
  end: my_end_token(M),
@@ -8192,7 +8496,7 @@ def_transform(AST_PrefixedTemplateString, function(self, tw) {
8192
8496
  type: "DebuggerStatement"
8193
8497
  };
8194
8498
  });
8195
- def_to_moz(AST_VarDef, function To_Moz_VariableDeclarator(M) {
8499
+ def_to_moz(AST_VarDefLike, function To_Moz_VariableDeclarator(M) {
8196
8500
  return {
8197
8501
  type: "VariableDeclarator",
8198
8502
  id: to_moz(M.name),
@@ -8243,6 +8547,16 @@ def_transform(AST_PrefixedTemplateString, function(self, tw) {
8243
8547
  };
8244
8548
  });
8245
8549
 
8550
+ def_to_moz(AST_DynamicImport, function To_Moz_ImportExpression(M) {
8551
+ const [source, options] = M.args.map(to_moz);
8552
+ return {
8553
+ type: "ImportExpression",
8554
+ source,
8555
+ options: options || null,
8556
+ phase: M.phase
8557
+ };
8558
+ });
8559
+
8246
8560
  def_to_moz(AST_Toplevel, function To_Moz_Program(M) {
8247
8561
  return to_moz_scope("Program", M);
8248
8562
  });
@@ -8408,12 +8722,14 @@ def_transform(AST_PrefixedTemplateString, function(self, tw) {
8408
8722
  };
8409
8723
  });
8410
8724
 
8411
- def_to_moz(AST_Definitions, function To_Moz_VariableDeclaration(M) {
8725
+ def_to_moz(AST_DefinitionsLike, function To_Moz_VariableDeclaration(M) {
8412
8726
  return {
8413
8727
  type: "VariableDeclaration",
8414
8728
  kind:
8415
8729
  M instanceof AST_Const ? "const" :
8416
- M instanceof AST_Let ? "let" : "var",
8730
+ M instanceof AST_Let ? "let" :
8731
+ M instanceof AST_Using ? (M.await ? "await using" : "using") :
8732
+ "var",
8417
8733
  declarations: M.definitions.map(to_moz)
8418
8734
  };
8419
8735
  });
@@ -8505,12 +8821,14 @@ def_transform(AST_PrefixedTemplateString, function(self, tw) {
8505
8821
  });
8506
8822
  }
8507
8823
  }
8508
- return {
8824
+ var moz = {
8509
8825
  type: "ImportDeclaration",
8510
8826
  specifiers: specifiers,
8511
8827
  source: to_moz(M.module_name),
8512
8828
  attributes: import_attributes_to_moz(M.attributes)
8513
8829
  };
8830
+ if (M.phase) moz.phase = M.phase;
8831
+ return moz;
8514
8832
  });
8515
8833
 
8516
8834
  def_to_moz(AST_ImportMeta, function To_Moz_MetaProperty() {
@@ -9390,14 +9708,64 @@ function OutputStream(options) {
9390
9708
  while (code.length < 4) code = "0" + code;
9391
9709
  return "\\u" + code;
9392
9710
  }
9393
- });
9394
- } : function(str) {
9395
- return str.replace(/[\ud800-\udbff][\udc00-\udfff]|([\ud800-\udbff]|[\udc00-\udfff])/g, function(match, lone) {
9396
- if (lone) {
9397
- return "\\u" + lone.charCodeAt(0).toString(16);
9711
+ });
9712
+ } : function(str) {
9713
+ return str.replace(/[\ud800-\udbff][\udc00-\udfff]|([\ud800-\udbff]|[\udc00-\udfff])/g, function(match, lone) {
9714
+ if (lone) {
9715
+ return "\\u" + lone.charCodeAt(0).toString(16);
9716
+ }
9717
+ return match;
9718
+ });
9719
+ };
9720
+
9721
+ /** Matches an identifier with non-ascii characters */
9722
+ var re_high_identifier = (() => {
9723
+ try {
9724
+ return new RegExp("^(?![\\u0000-\\u00ff]+$)([\\p{ID_Start}][\\p{ID_Continue}]*)$", "u");
9725
+ } catch (_) {
9726
+ return undefined; /* \p in regex above is unsupported */
9727
+ }
9728
+ })();
9729
+
9730
+ var ident_to_utf8 = (options.ascii_only || !re_high_identifier) ? to_utf8 : function (str) {
9731
+ if (re_high_identifier.test(str)) {
9732
+ str = str.replace(/[\ud800-\udbff][\udc00-\udfff]|([\ud800-\udbff]|[\udc00-\udfff])/g, function(match, lone) {
9733
+ if (lone) {
9734
+ return "\\u" + lone.charCodeAt(0).toString(16).padStart(4, "0");
9735
+ }
9736
+ return match;
9737
+ });
9738
+
9739
+ // Escape identifier characters from higher unicode versions
9740
+ var char = get_full_char(str, 0);
9741
+ var escaped = char;
9742
+ if (
9743
+ is_identifier_start_broad(char)
9744
+ && !is_identifier_start(char)
9745
+ ) {
9746
+ const code_point = char.codePointAt(0);
9747
+ escaped = code_point <= 0xffff
9748
+ ? `\\u${code_point.toString(16).padStart(4, "0")}`
9749
+ : `\\u{${code_point.toString(16)}}`;
9750
+ }
9751
+ for (var i = char.length; i < str.length; i += char.length) {
9752
+ char = get_full_char(str, i);
9753
+ if (
9754
+ is_identifier_char_broad(char)
9755
+ && !is_identifier_char(char)
9756
+ ) {
9757
+ const code_point = char.codePointAt(0);
9758
+ escaped += code_point <= 0xffff
9759
+ ? `\\u${code_point.toString(16).padStart(4, "0")}`
9760
+ : `\\u{${code_point.toString(16)}}`;
9761
+ } else {
9762
+ escaped += char;
9763
+ }
9398
9764
  }
9399
- return match;
9400
- });
9765
+ return escaped;
9766
+ } else {
9767
+ return str;
9768
+ }
9401
9769
  };
9402
9770
 
9403
9771
  function make_string(str, quote) {
@@ -9457,7 +9825,7 @@ function OutputStream(options) {
9457
9825
 
9458
9826
  function make_name(name) {
9459
9827
  name = name.toString();
9460
- name = to_utf8(name, true);
9828
+ name = ident_to_utf8(name, true);
9461
9829
  return name;
9462
9830
  }
9463
9831
 
@@ -9574,8 +9942,8 @@ function OutputStream(options) {
9574
9942
  }
9575
9943
 
9576
9944
  if (might_need_space) {
9577
- if ((is_identifier_char(prev)
9578
- && (is_identifier_char(ch) || ch == "\\"))
9945
+ if ((is_identifier_char_broad(prev)
9946
+ && (is_identifier_char_broad(ch) || ch == "\\"))
9579
9947
  || (ch == "/" && ch == prev)
9580
9948
  || ((ch == "+" || ch == "-") && ch == last)
9581
9949
  ) {
@@ -10080,21 +10448,21 @@ function OutputStream(options) {
10080
10448
 
10081
10449
  PARENS(AST_Sequence, function(output) {
10082
10450
  var p = output.parent();
10083
- return p instanceof AST_Call // (foo, bar)() or foo(1, (2, 3), 4)
10084
- || p instanceof AST_Unary // !(foo, bar, baz)
10085
- || p instanceof AST_Binary // 1 + (2, 3) + 4 ==> 8
10086
- || p instanceof AST_VarDef // var a = (1, 2), b = a + a; ==> b == 4
10087
- || p instanceof AST_PropAccess // (1, {foo:2}).foo or (1, {foo:2})["foo"] ==> 2
10088
- || p instanceof AST_Array // [ 1, (2, 3), 4 ] ==> [ 1, 3, 4 ]
10089
- || p instanceof AST_ObjectProperty // { foo: (1, 2) }.foo ==> 2
10090
- || p instanceof AST_Conditional /* (false, true) ? (a = 10, b = 20) : (c = 30)
10091
- * ==> 20 (side effect, set a := 10 and b := 20) */
10092
- || p instanceof AST_Arrow // x => (x, x)
10093
- || p instanceof AST_DefaultAssign // x => (x = (0, function(){}))
10094
- || p instanceof AST_Expansion // [...(a, b)]
10095
- || p instanceof AST_ForOf && this === p.object // for (e of (foo, bar)) {}
10096
- || p instanceof AST_Yield // yield (foo, bar)
10097
- || p instanceof AST_Export // export default (foo, bar)
10451
+ return p instanceof AST_Call // (foo, bar)() or foo(1, (2, 3), 4)
10452
+ || p instanceof AST_Unary // !(foo, bar, baz)
10453
+ || p instanceof AST_Binary // 1 + (2, 3) + 4 ==> 8
10454
+ || p instanceof AST_VarDefLike // var a = (1, 2), b = a + a; ==> b == 4
10455
+ || p instanceof AST_PropAccess && this !== p.property // (1, {foo:2}).foo, (1, {foo:2})["foo"], not foo[1, 2]
10456
+ || p instanceof AST_Array // [ 1, (2, 3), 4 ] ==> [ 1, 3, 4 ]
10457
+ || p instanceof AST_ObjectProperty // { foo: (1, 2) }.foo ==> 2
10458
+ || p instanceof AST_Conditional /* (false, true) ? (a = 10, b = 20) : (c = 30)
10459
+ * ==> 20 (side effect, set a := 10 and b := 20) */
10460
+ || p instanceof AST_Arrow // x => (x, x)
10461
+ || p instanceof AST_DefaultAssign // x => (x = (0, function(){}))
10462
+ || p instanceof AST_Expansion // [...(a, b)]
10463
+ || p instanceof AST_ForOf && this === p.object // for (e of (foo, bar)) {}
10464
+ || p instanceof AST_Yield // yield (foo, bar)
10465
+ || p instanceof AST_Export // export default (foo, bar)
10098
10466
  ;
10099
10467
  });
10100
10468
 
@@ -10415,7 +10783,7 @@ function OutputStream(options) {
10415
10783
  output.space();
10416
10784
  output.with_parens(function() {
10417
10785
  if (self.init) {
10418
- if (self.init instanceof AST_Definitions) {
10786
+ if (self.init instanceof AST_DefinitionsLike) {
10419
10787
  self.init.print(output);
10420
10788
  } else {
10421
10789
  parenthesize_for_noin(self.init, output, true);
@@ -10775,7 +11143,7 @@ function OutputStream(options) {
10775
11143
  });
10776
11144
 
10777
11145
  /* -----[ var/const ]----- */
10778
- AST_Definitions.DEFMETHOD("_do_print", function(output, kind) {
11146
+ AST_DefinitionsLike.DEFMETHOD("_do_print", function(output, kind) {
10779
11147
  output.print(kind);
10780
11148
  output.space();
10781
11149
  this.definitions.forEach(function(def, i) {
@@ -10797,9 +11165,16 @@ function OutputStream(options) {
10797
11165
  DEFPRINT(AST_Const, function(self, output) {
10798
11166
  self._do_print(output, "const");
10799
11167
  });
11168
+ DEFPRINT(AST_Using, function(self, output) {
11169
+ self._do_print(output, self.await ? "await using" : "using");
11170
+ });
10800
11171
  DEFPRINT(AST_Import, function(self, output) {
10801
11172
  output.print("import");
10802
11173
  output.space();
11174
+ if (self.phase) {
11175
+ output.print(self.phase);
11176
+ output.space();
11177
+ }
10803
11178
  if (self.imported_name) {
10804
11179
  self.imported_name.print(output);
10805
11180
  }
@@ -10840,6 +11215,15 @@ function OutputStream(options) {
10840
11215
  DEFPRINT(AST_ImportMeta, function(self, output) {
10841
11216
  output.print("import.meta");
10842
11217
  });
11218
+ DEFPRINT(AST_DynamicImport, function(self, output) {
11219
+ output.print("import." + self.phase);
11220
+ output.with_parens(function() {
11221
+ self.args.forEach(function(arg, i) {
11222
+ if (i) output.comma();
11223
+ arg.print(output);
11224
+ });
11225
+ });
11226
+ });
10843
11227
 
10844
11228
  DEFPRINT(AST_NameMapping, function(self, output) {
10845
11229
  var is_import = output.parent() instanceof AST_Import;
@@ -10964,7 +11348,7 @@ function OutputStream(options) {
10964
11348
  node.print(output, parens);
10965
11349
  }
10966
11350
 
10967
- DEFPRINT(AST_VarDef, function(self, output) {
11351
+ DEFPRINT(AST_VarDefLike, function(self, output) {
10968
11352
  self.name.print(output);
10969
11353
  if (self.value) {
10970
11354
  output.space();
@@ -11440,7 +11824,7 @@ function OutputStream(options) {
11440
11824
  } else {
11441
11825
  if (!stat || stat instanceof AST_EmptyStatement)
11442
11826
  output.force_semicolon();
11443
- else if (stat instanceof AST_Let || stat instanceof AST_Const || stat instanceof AST_Class)
11827
+ else if ((stat instanceof AST_DefinitionsLike && !(stat instanceof AST_Var)) || stat instanceof AST_Class)
11444
11828
  make_block(stat, output);
11445
11829
  else
11446
11830
  stat.print(output);
@@ -11520,7 +11904,7 @@ function OutputStream(options) {
11520
11904
  AST_Class,
11521
11905
  AST_Constant,
11522
11906
  AST_Debugger,
11523
- AST_Definitions,
11907
+ AST_DefinitionsLike,
11524
11908
  AST_Directive,
11525
11909
  AST_Finally,
11526
11910
  AST_Jump,
@@ -11683,20 +12067,27 @@ AST_Catch.prototype.shallow_cmp = function(other) {
11683
12067
 
11684
12068
  AST_Finally.prototype.shallow_cmp = pass_through;
11685
12069
 
11686
- AST_Definitions.prototype.shallow_cmp = pass_through;
12070
+ AST_DefinitionsLike.prototype.shallow_cmp = pass_through;
11687
12071
 
11688
- AST_VarDef.prototype.shallow_cmp = function(other) {
12072
+ AST_VarDefLike.prototype.shallow_cmp = function(other) {
11689
12073
  return this.value == null ? other.value == null : this.value === other.value;
11690
12074
  };
11691
12075
 
11692
12076
  AST_NameMapping.prototype.shallow_cmp = pass_through;
11693
12077
 
11694
12078
  AST_Import.prototype.shallow_cmp = function(other) {
11695
- 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) && (this.attributes == null ? other.attributes == null : this.attributes === other.attributes);
12079
+ return (this.imported_name || null) === (other.imported_name || null)
12080
+ && (this.imported_names || null) === (other.imported_names || null)
12081
+ && (this.attributes || null) === (other.attributes || null)
12082
+ && (this.phase || null) === (other.phase || null);
11696
12083
  };
11697
12084
 
11698
12085
  AST_ImportMeta.prototype.shallow_cmp = pass_through;
11699
12086
 
12087
+ AST_DynamicImport.prototype.shallow_cmp = function(other) {
12088
+ return (this.phase || null) === (other.phase || null) && this.args.length === other.args.length;
12089
+ };
12090
+
11700
12091
  AST_Export.prototype.shallow_cmp = function(other) {
11701
12092
  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.attributes == null ? other.attributes == null : this.attributes === other.attributes) && this.module_name === other.module_name && this.is_default === other.is_default;
11702
12093
  };
@@ -11710,7 +12101,10 @@ AST_PropAccess.prototype.shallow_cmp = pass_through;
11710
12101
  AST_Chain.prototype.shallow_cmp = pass_through;
11711
12102
 
11712
12103
  AST_Dot.prototype.shallow_cmp = function(other) {
11713
- return this.property === other.property;
12104
+ return (
12105
+ this.property === other.property
12106
+ && !!this.quote === !!other.quote
12107
+ );
11714
12108
  };
11715
12109
 
11716
12110
  AST_DotHash.prototype.shallow_cmp = function(other) {
@@ -12054,6 +12448,7 @@ AST_Scope.DEFMETHOD("figure_out_scope", function(options, { parent_scope = undef
12054
12448
  node instanceof AST_SymbolVar
12055
12449
  || node instanceof AST_SymbolLet
12056
12450
  || node instanceof AST_SymbolConst
12451
+ || node instanceof AST_SymbolUsing
12057
12452
  || node instanceof AST_SymbolCatch
12058
12453
  ) {
12059
12454
  var def;
@@ -12067,7 +12462,7 @@ AST_Scope.DEFMETHOD("figure_out_scope", function(options, { parent_scope = undef
12067
12462
  if (node instanceof AST_SymbolBlockDeclaration) {
12068
12463
  return sym instanceof AST_SymbolLambda;
12069
12464
  }
12070
- return !(sym instanceof AST_SymbolLet || sym instanceof AST_SymbolConst);
12465
+ return !(sym instanceof AST_SymbolLet || sym instanceof AST_SymbolConst || sym instanceof AST_SymbolUsing);
12071
12466
  })) {
12072
12467
  js_error(
12073
12468
  `"${node.name}" is redeclared`,
@@ -12588,6 +12983,7 @@ AST_Toplevel.DEFMETHOD("mangle_names", function(options) {
12588
12983
  if (
12589
12984
  function_defs
12590
12985
  && node instanceof AST_VarDef
12986
+ && node.name instanceof AST_Symbol
12591
12987
  && node.value instanceof AST_Lambda
12592
12988
  && !node.value.name
12593
12989
  && keep_name(options.keep_fnames, node.name.name)
@@ -12947,7 +13343,12 @@ AST_Const.prototype._size = function () {
12947
13343
  return 6 + list_overhead(this.definitions);
12948
13344
  };
12949
13345
 
12950
- AST_VarDef.prototype._size = function () {
13346
+ AST_Using.prototype._size = function () {
13347
+ const await_size = this.await ? 6 : 0;
13348
+ return await_size + 6 + list_overhead(this.definitions);
13349
+ };
13350
+
13351
+ AST_VarDefLike.prototype._size = function () {
12951
13352
  return this.value ? 1 : 0;
12952
13353
  };
12953
13354
 
@@ -12975,6 +13376,11 @@ AST_Import.prototype._size = function () {
12975
13376
 
12976
13377
  AST_ImportMeta.prototype._size = () => 11;
12977
13378
 
13379
+ AST_DynamicImport.prototype._size = function () {
13380
+ // `import.` + phase + `()` + arg overhead
13381
+ return 9 + this.phase.length + list_overhead(this.args);
13382
+ };
13383
+
12978
13384
  AST_Export.prototype._size = function () {
12979
13385
  let size = 7 + (this.is_default ? 8 : 0);
12980
13386
 
@@ -13366,7 +13772,7 @@ function make_node_from_constant(val, orig) {
13366
13772
  case "boolean":
13367
13773
  return make_node(val ? AST_True : AST_False, orig);
13368
13774
  case "undefined":
13369
- return make_node(AST_Undefined, orig);
13775
+ return make_void_0(orig);
13370
13776
  default:
13371
13777
  if (val === null) {
13372
13778
  return make_node(AST_Null, orig, { value: null });
@@ -13417,7 +13823,7 @@ function get_simple_key(key) {
13417
13823
  if (key instanceof AST_UnaryPrefix
13418
13824
  && key.operator == "void"
13419
13825
  && key.expression instanceof AST_Constant) {
13420
- return;
13826
+ return undefined;
13421
13827
  }
13422
13828
  return key;
13423
13829
  }
@@ -13527,6 +13933,7 @@ function can_be_evicted_from_block(node) {
13527
13933
  node instanceof AST_Defun ||
13528
13934
  node instanceof AST_Let ||
13529
13935
  node instanceof AST_Const ||
13936
+ node instanceof AST_Using ||
13530
13937
  node instanceof AST_Export ||
13531
13938
  node instanceof AST_Import
13532
13939
  );
@@ -13638,10 +14045,14 @@ function retain_top_func(fn, compressor) {
13638
14045
  // Note: Lots of methods and functions are missing here, in case they aren't pure
13639
14046
  // or not available in all JS environments.
13640
14047
 
13641
- function make_nested_lookup(obj) {
14048
+ const make_nested_lookup = (feature_callback) => (compressor) => {
14049
+ const obj = feature_callback(feature_variables(compressor));
14050
+
13642
14051
  const out = new Map();
13643
14052
  for (var key of Object.keys(obj)) {
13644
- out.set(key, makePredicate(obj[key]));
14053
+ if (obj[key]) {
14054
+ out.set(key, makePredicate(remove_false(obj[key])));
14055
+ }
13645
14056
  }
13646
14057
 
13647
14058
  const does_have = (global_name, fname) => {
@@ -13649,8 +14060,74 @@ function make_nested_lookup(obj) {
13649
14060
  return inner_map != null && inner_map.has(fname);
13650
14061
  };
13651
14062
  return does_have;
14063
+ };
14064
+
14065
+ const make_lookup = (feature_callback) => (compressor) => {
14066
+ const obj = feature_callback(feature_variables(compressor));
14067
+
14068
+ const predicate = makePredicate(remove_false(obj));
14069
+ const does_have = (global_name) => {
14070
+ return predicate.has(global_name);
14071
+ };
14072
+ return does_have;
14073
+ };
14074
+
14075
+ function remove_false(arr) {
14076
+ for (let i = 0; i < arr.length; i++) {
14077
+ if (arr[i] === false) {
14078
+ arr.splice(i, 1);
14079
+ i--;
14080
+ }
14081
+ }
14082
+ return arr;
14083
+ }
14084
+
14085
+ /** Generate the object with arguments seen below */
14086
+ function feature_variables(compressor) {
14087
+ return {
14088
+ sloppy: compressor.option("unsafe"),
14089
+ es: compressor.option("builtins_ecma"),
14090
+ };
13652
14091
  }
13653
14092
 
14093
+ // eslint-disable-next-line no-unused-vars
14094
+ const pure_access_globals = make_lookup(({ sloppy, es }) => [
14095
+ "Array",
14096
+ "Boolean",
14097
+ "clearInterval",
14098
+ "clearTimeout",
14099
+ "console",
14100
+ "Date",
14101
+ "decodeURI",
14102
+ "decodeURIComponent",
14103
+ "encodeURI",
14104
+ "encodeURIComponent",
14105
+ "Error",
14106
+ "escape",
14107
+ "eval",
14108
+ "EvalError",
14109
+ "Function",
14110
+ es >= 2020 && "globalThis",
14111
+ "isFinite",
14112
+ "isNaN",
14113
+ "JSON",
14114
+ "Math",
14115
+ "Number",
14116
+ "parseFloat",
14117
+ "parseInt",
14118
+ "RangeError",
14119
+ "ReferenceError",
14120
+ "RegExp",
14121
+ "Object",
14122
+ "setInterval",
14123
+ "setTimeout",
14124
+ "String",
14125
+ "SyntaxError",
14126
+ "TypeError",
14127
+ "unescape",
14128
+ "URIError",
14129
+ ]);
14130
+
13654
14131
  // Objects which are safe to access without throwing or causing a side effect.
13655
14132
  // Usually we'd check the `unsafe` option first but these are way too common for that
13656
14133
  const pure_prop_access_globals = new Set([
@@ -13662,17 +14139,90 @@ const pure_prop_access_globals = new Set([
13662
14139
  "Promise",
13663
14140
  ]);
13664
14141
 
14142
+ // eslint-disable-next-line no-unused-vars
14143
+ const is_pure_native_fn = make_lookup(({ sloppy, es }) => [
14144
+ sloppy && es >= 2021 && "AggregateError",
14145
+ "Array",
14146
+ "ArrayBuffer",
14147
+ es >= 2020 && "BigInt",
14148
+ es >= 2020 && "BigInt64Array",
14149
+ es >= 2020 && "BigUint64Array",
14150
+ "Boolean",
14151
+ "Date",
14152
+ sloppy && "decodeURI",
14153
+ sloppy && "decodeURIComponent",
14154
+ sloppy && "encodeURI",
14155
+ sloppy && "encodeURIComponent",
14156
+ "Error",
14157
+ "escape",
14158
+ "EvalError",
14159
+ es >= 2021 && "FinalizationRegistry",
14160
+ es >= 2026 && "Float16Array",
14161
+ "Float32Array",
14162
+ "Float64Array",
14163
+ "Int16Array",
14164
+ "Int32Array",
14165
+ "Int8Array",
14166
+ "isFinite",
14167
+ "isNaN",
14168
+ es >= 2026 && "Iterator",
14169
+ es >= 2015 && "Map",
14170
+ "Number",
14171
+ "parseFloat",
14172
+ "parseInt",
14173
+ es >= 2015 && "Promise",
14174
+ es >= 2015 && "Proxy",
14175
+ "RangeError",
14176
+ "ReferenceError",
14177
+ sloppy && "RegExp",
14178
+ es >= 2015 && "Set",
14179
+ "String",
14180
+ es >= 2015 && "Symbol",
14181
+ "SyntaxError",
14182
+ "TypeError",
14183
+ "Uint16Array",
14184
+ "Uint32Array",
14185
+ "Uint8Array",
14186
+ "Uint8ClampedArray",
14187
+ sloppy && "unescape",
14188
+ "URIError",
14189
+ sloppy && es >= 2015 && "WeakMap",
14190
+ sloppy && es >= 2021 && "WeakRef",
14191
+ sloppy && es >= 2015 && "WeakSet",
14192
+ ]);
14193
+
14194
+ const arg1_is_iterable = new Set([
14195
+ "Map",
14196
+ "Set",
14197
+ "WeakMap",
14198
+ "WeakSet",
14199
+ ]);
14200
+ const arg1_is_range_or_iterable = new Set([
14201
+ "ArrayBuffer",
14202
+ "Float32Array",
14203
+ "Float64Array",
14204
+ "Int16Array",
14205
+ "Int32Array",
14206
+ "Int8Array",
14207
+ "Uint16Array",
14208
+ "Uint32Array",
14209
+ "Uint8Array",
14210
+ "Uint8ClampedArray",
14211
+ ]);
14212
+ const lone_arg_is_range = new Set(["Array"]);
14213
+
13665
14214
  const object_methods = [
13666
14215
  "constructor",
13667
14216
  "toString",
13668
14217
  "valueOf",
13669
14218
  ];
13670
14219
 
13671
- const is_pure_native_method = make_nested_lookup({
14220
+ // eslint-disable-next-line no-unused-vars
14221
+ const is_pure_native_method = make_nested_lookup(({ sloppy, es }) => ({
13672
14222
  Array: [
13673
- "at",
13674
- "flat",
13675
- "includes",
14223
+ es >= 2022 && "at",
14224
+ es >= 2019 && "flat",
14225
+ es >= 2016 && "includes",
13676
14226
  "indexOf",
13677
14227
  "join",
13678
14228
  "lastIndexOf",
@@ -13693,90 +14243,160 @@ const is_pure_native_method = make_nested_lookup({
13693
14243
  ...object_methods,
13694
14244
  ],
13695
14245
  String: [
13696
- "at",
14246
+ es >= 2022 && "at",
13697
14247
  "charAt",
13698
14248
  "charCodeAt",
13699
- "charPointAt",
14249
+ es >= 2015 && "codePointAt",
13700
14250
  "concat",
13701
- "endsWith",
13702
- "fromCharCode",
13703
- "fromCodePoint",
13704
- "includes",
14251
+ es >= 2025 && "endsWith",
14252
+ es >= 2015 && "includes",
13705
14253
  "indexOf",
13706
14254
  "italics",
13707
14255
  "lastIndexOf",
13708
- "localeCompare",
14256
+ es >= 2020 && "localeCompare",
13709
14257
  "match",
13710
- "matchAll",
13711
- "normalize",
13712
- "padStart",
13713
- "padEnd",
13714
- "repeat",
14258
+ es >= 2020 && "matchAll",
14259
+ es >= 2015 && "normalize",
14260
+ es >= 2017 && "padStart",
14261
+ es >= 2017 && "padEnd",
14262
+ es >= 2015 && sloppy && "repeat",
13715
14263
  "replace",
13716
- "replaceAll",
14264
+ es >= 2021 && "replaceAll",
13717
14265
  "search",
13718
14266
  "slice",
13719
14267
  "split",
13720
- "startsWith",
14268
+ es >= 2015 && "startsWith",
13721
14269
  "substr",
13722
14270
  "substring",
13723
- "repeat",
14271
+ es >= 2015 && "repeat",
13724
14272
  "toLocaleLowerCase",
13725
14273
  "toLocaleUpperCase",
13726
14274
  "toLowerCase",
13727
14275
  "toUpperCase",
13728
14276
  "trim",
13729
- "trimEnd",
13730
- "trimStart",
14277
+ es >= 2019 && "trimEnd",
14278
+ es >= 2019 && "trimStart",
14279
+ es >= 2019 && "trimLeft",
14280
+ es >= 2019 && "trimRight",
13731
14281
  ...object_methods,
13732
14282
  ],
13733
- });
14283
+ }));
13734
14284
 
13735
- const is_pure_native_fn = make_nested_lookup({
14285
+ // eslint-disable-next-line no-unused-vars
14286
+ const is_pure_native_static_fn = make_nested_lookup(({ sloppy, es }) => ({
13736
14287
  Array: [
13737
14288
  "isArray",
14289
+ es >= 2015 && "of",
14290
+ ],
14291
+ ArrayBuffer: [
14292
+ "isView",
14293
+ ],
14294
+ BigInt: es >= 2020 && [
14295
+ sloppy && "asIntN",
14296
+ sloppy && "asUintN",
14297
+ ],
14298
+ BigInt64Array: sloppy && es >= 2020 && ["of"],
14299
+ BigUint64Array: sloppy && es >= 2020 && ["of"],
14300
+ Date: [
14301
+ "now",
14302
+ "parse",
14303
+ "UTC",
14304
+ ],
14305
+ Error: [
14306
+ es >= 2026 && "isError",
13738
14307
  ],
14308
+ Float16Array: sloppy && es >= 2026 && ["of"],
14309
+ Float32Array: sloppy && ["of"],
14310
+ Float64Array: sloppy && ["of"],
14311
+ Int16Array: sloppy && ["of"],
14312
+ Int32Array: sloppy && ["of"],
14313
+ Int8Array: sloppy && ["of"],
13739
14314
  Math: [
13740
14315
  "abs",
13741
14316
  "acos",
14317
+ es >= 2015 && "acosh",
13742
14318
  "asin",
14319
+ es >= 2015 && "asinh",
13743
14320
  "atan",
14321
+ "atan2",
14322
+ es >= 2015 && "atanh",
14323
+ es >= 2015 && "cbrt",
13744
14324
  "ceil",
14325
+ es >= 2015 && "clz32",
13745
14326
  "cos",
14327
+ es >= 2015 && "cosh",
13746
14328
  "exp",
14329
+ es >= 2015 && "expm1",
13747
14330
  "floor",
14331
+ es >= 2026 && "f16round",
14332
+ es >= 2015 && "fround",
14333
+ es >= 2015 && "hypot",
14334
+ es >= 2015 && "imul",
13748
14335
  "log",
14336
+ es >= 2015 && "log10",
14337
+ es >= 2015 && "log1p",
14338
+ es >= 2015 && "log2",
14339
+ "max",
14340
+ "min",
14341
+ "pow",
13749
14342
  "round",
14343
+ es >= 2015 && "sign",
13750
14344
  "sin",
14345
+ es >= 2015 && "sinh",
13751
14346
  "sqrt",
13752
14347
  "tan",
13753
- "atan2",
13754
- "pow",
13755
- "max",
13756
- "min",
14348
+ es >= 2015 && "tanh",
14349
+ es >= 2015 && "trunc",
13757
14350
  ],
13758
14351
  Number: [
13759
- "isFinite",
13760
- "isNaN",
14352
+ es >= 2015 && "isFinite",
14353
+ es >= 2015 && "isInteger",
14354
+ es >= 2015 && "isSafeInteger",
14355
+ es >= 2015 && "isNaN",
14356
+ es >= 2015 && "parseFloat",
14357
+ es >= 2015 && "parseInt",
13761
14358
  ],
13762
14359
  Object: [
13763
- "create",
13764
- "getOwnPropertyDescriptor",
13765
- "getOwnPropertyNames",
13766
- "getPrototypeOf",
14360
+ sloppy && "create",
14361
+ sloppy && "getOwnPropertyDescriptor",
14362
+ es >= 2017 && sloppy && "getOwnPropertyDescriptors",
14363
+ sloppy && "getOwnPropertyNames",
14364
+ es >= 2015 && sloppy && "getOwnPropertySymbols",
14365
+ sloppy && "getPrototypeOf",
14366
+ es >= 2022 && sloppy && "hasOwn",
14367
+ es >= 2015 && "is",
13767
14368
  "isExtensible",
13768
14369
  "isFrozen",
13769
14370
  "isSealed",
13770
- "hasOwn",
13771
- "keys",
14371
+ es >= 2015 && sloppy && "keys",
14372
+ ],
14373
+ Promise: es >= 2015 && [
14374
+ es >= 2024 && "withResolvers",
14375
+ ],
14376
+ Proxy: es >= 2015 && [
14377
+ sloppy && "revocable",
14378
+ ],
14379
+ Reflect: es >= 2015 && [
14380
+ sloppy && "has",
14381
+ sloppy && "isExtensible",
14382
+ sloppy && "ownKeys",
14383
+ ],
14384
+ RegExp: [
14385
+ es >= 2026 && sloppy && "escape",
13772
14386
  ],
13773
14387
  String: [
13774
14388
  "fromCharCode",
14389
+ sloppy && es >= 2025 && "fromCodePoint",
13775
14390
  ],
13776
- });
14391
+ Uint16Array: ["of"],
14392
+ Uint32Array: ["of"],
14393
+ Uint8Array: ["of"],
14394
+ Uint8ClampedArray: ["of"],
14395
+ }));
13777
14396
 
13778
14397
  // Known numeric values which come with JS environments
13779
- const is_pure_native_value = make_nested_lookup({
14398
+ // eslint-disable-next-line no-unused-vars
14399
+ const is_pure_native_static_property = make_nested_lookup(({ sloppy, es }) => ({
13780
14400
  Math: [
13781
14401
  "E",
13782
14402
  "LN10",
@@ -13788,13 +14408,130 @@ const is_pure_native_value = make_nested_lookup({
13788
14408
  "SQRT2",
13789
14409
  ],
13790
14410
  Number: [
14411
+ es >= 2015 && "EPSILON",
14412
+ es >= 2015 && "MAX_SAFE_VALUE",
13791
14413
  "MAX_VALUE",
14414
+ es >= 2015 && "MIN_SAFE_VALUE",
13792
14415
  "MIN_VALUE",
13793
14416
  "NaN",
13794
14417
  "NEGATIVE_INFINITY",
13795
14418
  "POSITIVE_INFINITY",
13796
14419
  ],
13797
- });
14420
+ RegExp: [
14421
+ "$_",
14422
+ "$0",
14423
+ "$1",
14424
+ "$2",
14425
+ "$3",
14426
+ "$4",
14427
+ "$5",
14428
+ "$6",
14429
+ "$7",
14430
+ "$8",
14431
+ "$9",
14432
+ "input",
14433
+ "lastMatch",
14434
+ "lastParen",
14435
+ "leftContext",
14436
+ "rightContext",
14437
+ ],
14438
+ }));
14439
+
14440
+ const re_uppercase_first_letter = /^[A-Z]/;
14441
+ function is_pure_builtin_call(compressor, call) {
14442
+ let builtin = "";
14443
+ let method = "";
14444
+
14445
+ let exp = call.expression;
14446
+ if (is_undeclared_ref(exp)) {
14447
+ builtin = exp.name;
14448
+ } else if (exp instanceof AST_Dot) {
14449
+ method = exp.property;
14450
+
14451
+ exp = exp.expression;
14452
+ if (is_undeclared_ref(exp)) {
14453
+ if (
14454
+ // globalThis.pureFunc()
14455
+ exp.name === "globalThis"
14456
+ && compressor.option("builtins_ecma") >= 2020
14457
+ ) {
14458
+ builtin = method;
14459
+ method = "";
14460
+ } else {
14461
+ // SomeBuiltin.pureFunc()
14462
+ builtin = exp.name;
14463
+ }
14464
+ } else if (exp instanceof AST_Dot) {
14465
+ if (
14466
+ is_undeclared_ref(exp.expression)
14467
+ && exp.expression.name === "globalThis"
14468
+ && compressor.option("builtins_ecma") >= 2020
14469
+ ) {
14470
+ // globalThis.SomeBuiltin.pureFunc()
14471
+ builtin = exp.property;
14472
+ } else {
14473
+ return false;
14474
+ }
14475
+ } else {
14476
+ return false;
14477
+ }
14478
+ } else {
14479
+ return false;
14480
+ }
14481
+
14482
+ if (!method) {
14483
+ if (compressor.is_pure_native_fn(builtin)) {
14484
+ // some require `new`, others throw if you use it
14485
+ const is_new = call instanceof AST_New;
14486
+ const should_be_new = re_uppercase_first_letter.test(builtin); // true of all `is_pure_native_fn`
14487
+ if (is_new !== should_be_new) return false;
14488
+
14489
+ if (!is_builtin_pure_with_these_args(builtin, call.args)) {
14490
+ return false;
14491
+ }
14492
+
14493
+ return true;
14494
+ }
14495
+
14496
+ return false;
14497
+ } else {
14498
+ return compressor.is_pure_native_static_fn(builtin, method);
14499
+ }
14500
+ }
14501
+
14502
+ /** Some builtins are listed above but their purity is subject to some conditions */
14503
+ function is_builtin_pure_with_these_args(builtin, args) {
14504
+ // all the builtins we deal with here are ok with getting 0 args
14505
+ if (args.length === 0) return true;
14506
+
14507
+ let arg1 = args[0];
14508
+ if (arg1 instanceof AST_SymbolRef) {
14509
+ arg1 = arg1.fixed_value();
14510
+ }
14511
+
14512
+ if (lone_arg_is_range.has(builtin)) { // new Array(number)
14513
+ const arg_valid = args.length > 1
14514
+ || arg1 instanceof AST_Number
14515
+ && arg1.value >= 0 && arg1.value <= 0xffffffff;
14516
+ // TODO: or, we are asked to ignore TypeError
14517
+ if (!arg_valid) return false;
14518
+ }
14519
+
14520
+ if (arg1_is_range_or_iterable.has(builtin)) { // new Float32Array(number | Array)
14521
+ const arg_valid = args.length === 0
14522
+ || arg1 instanceof AST_Array
14523
+ || arg1 instanceof AST_Number
14524
+ && arg1.value >= 0 && arg1.value <= 0xffffffff;
14525
+ if (!arg_valid) return false;
14526
+ }
14527
+
14528
+ if (arg1_is_iterable.has(builtin)) { // new Set(iterable)
14529
+ const arg_valid = args.length === 0 || arg1 instanceof AST_Array;
14530
+ if (!arg_valid) return false;
14531
+ }
14532
+
14533
+ return true;
14534
+ }
13798
14535
 
13799
14536
  /***********************************************************************
13800
14537
 
@@ -14112,6 +14849,10 @@ function is_nullish(node, compressor) {
14112
14849
  || this.alternative && this.alternative.has_side_effects(compressor);
14113
14850
  });
14114
14851
  def_has_side_effects(AST_ImportMeta, return_false);
14852
+ def_has_side_effects(AST_DynamicImport, function() {
14853
+ // `import.source(x)` only compiles the module, which is side-effect free
14854
+ return this.phase !== "source";
14855
+ });
14115
14856
  def_has_side_effects(AST_LabeledStatement, function(compressor) {
14116
14857
  return this.body.has_side_effects(compressor);
14117
14858
  });
@@ -14667,21 +15408,20 @@ var global_pure_fns = makePredicate("Boolean decodeURI decodeURIComponent Date e
14667
15408
  AST_Call.DEFMETHOD("is_callee_pure", function(compressor) {
14668
15409
  if (compressor.option("unsafe")) {
14669
15410
  var expr = this.expression;
14670
- var first_arg = (this.args && this.args[0] && this.args[0].evaluate(compressor));
15411
+ var first_arg;
14671
15412
  if (
14672
15413
  expr.expression && expr.expression.name === "hasOwnProperty" &&
14673
- (first_arg == null || first_arg.thedef && first_arg.thedef.undeclared)
15414
+ (
15415
+ (first_arg = (this.args && this.args[0] && this.args[0].evaluate(compressor))) == null
15416
+ || first_arg.thedef && first_arg.thedef.undeclared
15417
+ )
14674
15418
  ) {
14675
15419
  return false;
14676
15420
  }
14677
15421
  if (is_undeclared_ref(expr) && global_pure_fns.has(expr.name)) return true;
14678
- if (
14679
- expr instanceof AST_Dot
14680
- && is_undeclared_ref(expr.expression)
14681
- && is_pure_native_fn(expr.expression.name, expr.property)
14682
- ) {
14683
- return true;
14684
- }
15422
+ if (is_pure_builtin_call(compressor, this)) return true;
15423
+ } else if (compressor.option("builtins_pure")) {
15424
+ if (is_pure_builtin_call(compressor, this)) return true;
14685
15425
  }
14686
15426
  if ((this instanceof AST_New) && compressor.option("pure_new")) {
14687
15427
  return true;
@@ -14712,7 +15452,7 @@ AST_Dot.DEFMETHOD("is_call_pure", function(compressor) {
14712
15452
  } else if (!this.may_throw_on_access(compressor)) {
14713
15453
  native_obj = "Object";
14714
15454
  }
14715
- return native_obj != null && is_pure_native_method(native_obj, this.property);
15455
+ return native_obj != null && compressor.is_pure_native_method(native_obj, this.property);
14716
15456
  });
14717
15457
 
14718
15458
  // tell me if a statement aborts
@@ -15093,12 +15833,15 @@ def_eval(AST_Binary, function (compressor, depth) {
15093
15833
  return this;
15094
15834
  }
15095
15835
 
15096
- // Do not mix BigInt and Number; Don't use `>>>` on BigInt or `/ 0n`
15836
+ // Do not mix BigInt and Number
15837
+ // Don't use `>>>` on BigInt or `/ 0n` (error)
15838
+ // Don't use `**` on BigInt (slow)
15097
15839
  if (
15098
15840
  (typeof left === "bigint") !== (typeof right === "bigint")
15099
15841
  || typeof left === "bigint"
15100
- && (this.operator === ">>>"
15101
- || this.operator === "/" && Number(right) === 0)
15842
+ && (this.operator === "/" && Number(right) === 0
15843
+ || this.operator === ">>>"
15844
+ || this.operator === "**")
15102
15845
  ) {
15103
15846
  return this;
15104
15847
  }
@@ -15173,6 +15916,15 @@ def_eval(AST_SymbolRef, function (compressor, depth) {
15173
15916
  return value;
15174
15917
  });
15175
15918
 
15919
+ def_eval(AST_Chain, function (compressor, depth) {
15920
+ const evaluated = this.expression._eval(compressor, depth, /*ast_chain=*/true);
15921
+ return evaluated === nullish
15922
+ ? undefined
15923
+ : evaluated === this.expression
15924
+ ? this
15925
+ : evaluated;
15926
+ });
15927
+
15176
15928
  const global_objs = { Array, Math, Number, Object, String };
15177
15929
 
15178
15930
  const regexp_flags = new Set([
@@ -15184,9 +15936,13 @@ const regexp_flags = new Set([
15184
15936
  "unicode",
15185
15937
  ]);
15186
15938
 
15187
- def_eval(AST_PropAccess, function (compressor, depth) {
15188
- let obj = this.expression._eval(compressor, depth + 1);
15189
- if (obj === nullish || (this.optional && obj == null)) return nullish;
15939
+ def_eval(AST_PropAccess, function (compressor, depth, ast_chain) {
15940
+ let obj = (ast_chain || this.property === "length" || compressor.option("unsafe"))
15941
+ && this.expression._eval(compressor, depth + 1, ast_chain);
15942
+
15943
+ if (ast_chain) {
15944
+ if (obj === nullish || (this.optional && obj == null)) return nullish;
15945
+ }
15190
15946
 
15191
15947
  // `.length` of strings and arrays is always safe
15192
15948
  if (this.property === "length") {
@@ -15228,7 +15984,7 @@ def_eval(AST_PropAccess, function (compressor, depth) {
15228
15984
  if (first_arg == null || first_arg.thedef && first_arg.thedef.undeclared) {
15229
15985
  return this.clone();
15230
15986
  }
15231
- if (!is_pure_native_value(exp.name, key))
15987
+ if (!compressor.is_pure_native_static_property(exp.name, key))
15232
15988
  return this;
15233
15989
  obj = global_objs[exp.name];
15234
15990
  } else {
@@ -15257,26 +16013,19 @@ def_eval(AST_PropAccess, function (compressor, depth) {
15257
16013
  return this;
15258
16014
  });
15259
16015
 
15260
- def_eval(AST_Chain, function (compressor, depth) {
15261
- const evaluated = this.expression._eval(compressor, depth);
15262
- return evaluated === nullish
15263
- ? undefined
15264
- : evaluated === this.expression
15265
- ? this
15266
- : evaluated;
15267
- });
15268
-
15269
- def_eval(AST_Call, function (compressor, depth) {
16016
+ def_eval(AST_Call, function (compressor, depth, ast_chain) {
15270
16017
  var exp = this.expression;
15271
16018
 
15272
- const callee = exp._eval(compressor, depth);
15273
- if (callee === nullish || (this.optional && callee == null)) return nullish;
16019
+ if (ast_chain) {
16020
+ const callee = exp._eval(compressor, depth, ast_chain);
16021
+ if (callee === nullish || (this.optional && callee == null)) return nullish;
16022
+ }
15274
16023
 
15275
16024
  if (compressor.option("unsafe") && exp instanceof AST_PropAccess) {
15276
16025
  var key = exp.property;
15277
16026
  if (key instanceof AST_Node) {
15278
16027
  key = key._eval(compressor, depth);
15279
- if (key === exp.property)
16028
+ if (typeof key !== "string" && typeof key !== "number")
15280
16029
  return this;
15281
16030
  }
15282
16031
  var val;
@@ -15291,13 +16040,14 @@ def_eval(AST_Call, function (compressor, depth) {
15291
16040
  if ((first_arg == null || first_arg.thedef && first_arg.thedef.undeclared)) {
15292
16041
  return this.clone();
15293
16042
  }
15294
- if (!is_pure_native_fn(e.name, key)) return this;
16043
+ if (!compressor.is_pure_native_static_fn(e.name, key)) return this;
15295
16044
  val = global_objs[e.name];
15296
16045
  } else {
15297
- val = e._eval(compressor, depth + 1);
16046
+ val = e._eval(compressor, depth + 1, /* don't pass ast_chain (exponential work) */);
16047
+
15298
16048
  if (val === e || !val)
15299
16049
  return this;
15300
- if (!is_pure_native_method(val.constructor.name, key))
16050
+ if (!compressor.is_pure_native_method(val.constructor.name, key))
15301
16051
  return this;
15302
16052
  }
15303
16053
  var args = [];
@@ -15429,6 +16179,12 @@ def_drop_side_effect_free(AST_Call, function (compressor, first_in_statement) {
15429
16179
  return args && make_sequence(this, args);
15430
16180
  });
15431
16181
 
16182
+ def_drop_side_effect_free(AST_DynamicImport, function (compressor, first_in_statement) {
16183
+ if (this.phase !== "source") return this;
16184
+ var args = trim(this.args, compressor, first_in_statement);
16185
+ return args && make_sequence(this, args);
16186
+ });
16187
+
15432
16188
  def_drop_side_effect_free(AST_Accessor, return_null);
15433
16189
 
15434
16190
  def_drop_side_effect_free(AST_Function, return_null);
@@ -15589,8 +16345,8 @@ def_drop_side_effect_free([
15589
16345
  AST_ConciseMethod,
15590
16346
  AST_ObjectGetter,
15591
16347
  AST_ObjectSetter,
15592
- ], function () {
15593
- return this.computed_key() ? this.key : null;
16348
+ ], function (compressor, first_in_statement) {
16349
+ return this.computed_key() ? this.key.drop_side_effect_free(compressor, first_in_statement) : null;
15594
16350
  });
15595
16351
 
15596
16352
  def_drop_side_effect_free([
@@ -15812,6 +16568,7 @@ AST_Scope.DEFMETHOD("drop_unused", function(compressor) {
15812
16568
  return scan_ref_scoped(node, descend);
15813
16569
  });
15814
16570
  self.walk(tw);
16571
+
15815
16572
  // pass 2: for every used symbol we need to walk its
15816
16573
  // initialization code to figure out if it uses other
15817
16574
  // symbols (that may not be in_use).
@@ -15822,6 +16579,7 @@ AST_Scope.DEFMETHOD("drop_unused", function(compressor) {
15822
16579
  init.walk(tw);
15823
16580
  });
15824
16581
  });
16582
+
15825
16583
  // pass 3: we should drop declarations not in_use
15826
16584
  var tt = new TreeTransformer(
15827
16585
  function before(node, descend, in_list) {
@@ -16215,7 +16973,7 @@ function safe_to_read(tw, def) {
16215
16973
  if (def.fixed == null) {
16216
16974
  var orig = def.orig[0];
16217
16975
  if (orig instanceof AST_SymbolFunarg || orig.name == "arguments") return false;
16218
- def.fixed = make_node(AST_Undefined, orig);
16976
+ def.fixed = make_void_0(orig);
16219
16977
  }
16220
16978
  return true;
16221
16979
  }
@@ -16280,7 +17038,7 @@ function mark_escaped(tw, d, scope, node, value, level = 0, depth = 1) {
16280
17038
  parent instanceof AST_Assign && (parent.operator === "=" || parent.logical) && node === parent.right
16281
17039
  || parent instanceof AST_Call && (node !== parent.expression || parent instanceof AST_New)
16282
17040
  || parent instanceof AST_Exit && node === parent.value && node.scope !== d.scope
16283
- || parent instanceof AST_VarDef && node === parent.value
17041
+ || parent instanceof AST_VarDefLike && node === parent.value
16284
17042
  || parent instanceof AST_Yield && node === parent.value && node.scope !== d.scope
16285
17043
  ) {
16286
17044
  if (depth > 1 && !(value && value.is_constant_expression(scope))) depth = 1;
@@ -16513,7 +17271,7 @@ function mark_lambda(tw, descend, compressor) {
16513
17271
  if (d.orig.length > 1) return;
16514
17272
  if (d.fixed === undefined && (!this.uses_arguments || tw.has_directive("use strict"))) {
16515
17273
  d.fixed = function() {
16516
- return iife.args[i] || make_node(AST_Undefined, iife);
17274
+ return iife.args[i] || make_void_0(iife);
16517
17275
  };
16518
17276
  tw.loop_ids.set(d.id, tw.in_loop);
16519
17277
  mark(tw, d, true);
@@ -16663,7 +17421,7 @@ function handle_defined_after_hoist(parent) {
16663
17421
 
16664
17422
  // Refine `defun_first_read_map` to be as high as possible
16665
17423
  for (const [defun, defun_first_read] of defun_first_read_map) {
16666
- // Update all depdencies of `defun`
17424
+ // Update all dependencies of `defun`
16667
17425
  const queue = new Set(defun_dependencies_map.get(defun));
16668
17426
  for (const enclosed_defun of queue) {
16669
17427
  let enclosed_defun_first_read = defun_first_read_map.get(enclosed_defun);
@@ -16892,6 +17650,10 @@ def_reduce_vars(AST_VarDef, function(tw, descend) {
16892
17650
  }
16893
17651
  });
16894
17652
 
17653
+ def_reduce_vars(AST_UsingDef, function() {
17654
+ suppress(this.name);
17655
+ });
17656
+
16895
17657
  def_reduce_vars(AST_While, function(tw, descend, compressor) {
16896
17658
  reset_block_variables(compressor, this);
16897
17659
  const saved_loop = tw.in_loop;
@@ -16989,8 +17751,8 @@ function remove_initializers(var_statement) {
16989
17751
  return decls.length ? make_node(AST_Var, var_statement, { definitions: decls }) : null;
16990
17752
  }
16991
17753
 
16992
- /** Called on code which we know is unreachable, to keep elements that affect outside of it. */
16993
- function trim_unreachable_code(compressor, stat, target) {
17754
+ /** Called on code which won't be executed but has an effect outside of itself: `var`, `function` statements, `export`, `import`. */
17755
+ function extract_from_unreachable_code(compressor, stat, target) {
16994
17756
  walk(stat, node => {
16995
17757
  if (node instanceof AST_Var) {
16996
17758
  const no_initializers = remove_initializers(node);
@@ -17015,7 +17777,8 @@ function trim_unreachable_code(compressor, stat, target) {
17015
17777
  target.push(node);
17016
17778
  return true;
17017
17779
  }
17018
- if (node instanceof AST_Scope) {
17780
+ if (node instanceof AST_Scope || node instanceof AST_Class) {
17781
+ // Do not go into nested scopes
17019
17782
  return true;
17020
17783
  }
17021
17784
  });
@@ -17099,6 +17862,7 @@ function tighten_body(statements, compressor) {
17099
17862
  if (node instanceof AST_Assign
17100
17863
  && (node.logical || node.operator != "=" && lhs.equivalent_to(node.left))
17101
17864
  || node instanceof AST_Await
17865
+ || node instanceof AST_Using
17102
17866
  || node instanceof AST_Call && lhs instanceof AST_PropAccess && lhs.equivalent_to(node.expression)
17103
17867
  ||
17104
17868
  (node instanceof AST_Call || node instanceof AST_PropAccess)
@@ -17197,6 +17961,7 @@ function tighten_body(statements, compressor) {
17197
17961
  && ((lvalues.has(node.name) && lvalues.get(node.name).modified) || side_effects && may_modify(node))
17198
17962
  || node instanceof AST_VarDef && node.value
17199
17963
  && (lvalues.has(node.name.name) || side_effects && may_modify(node.name))
17964
+ || node instanceof AST_Using
17200
17965
  || (sym = is_lhs(node.left, node))
17201
17966
  && (sym instanceof AST_PropAccess || lvalues.has(sym.name))
17202
17967
  || may_throw
@@ -17430,7 +18195,7 @@ function tighten_body(statements, compressor) {
17430
18195
  }
17431
18196
  } else {
17432
18197
  if (!arg) {
17433
- arg = make_node(AST_Undefined, sym).transform(compressor);
18198
+ arg = make_void_0(sym).transform(compressor);
17434
18199
  } else if (arg instanceof AST_Lambda && arg.pinned()
17435
18200
  || has_overlapping_symbol(fn, arg, fn_strict)) {
17436
18201
  arg = null;
@@ -17611,7 +18376,9 @@ function tighten_body(statements, compressor) {
17611
18376
  ? expr.left
17612
18377
  : expr.expression;
17613
18378
  return !is_ref_of(lhs, AST_SymbolConst)
17614
- && !is_ref_of(lhs, AST_SymbolLet) && lhs;
18379
+ && !is_ref_of(lhs, AST_SymbolLet)
18380
+ && !is_ref_of(lhs, AST_SymbolUsing)
18381
+ && lhs;
17615
18382
  }
17616
18383
  }
17617
18384
 
@@ -17668,7 +18435,7 @@ function tighten_body(statements, compressor) {
17668
18435
  found = true;
17669
18436
  if (node instanceof AST_VarDef) {
17670
18437
  node.value = node.name instanceof AST_SymbolConst
17671
- ? make_node(AST_Undefined, node.value) // `const` always needs value.
18438
+ ? make_void_0(node.value) // `const` always needs value.
17672
18439
  : null;
17673
18440
  return node;
17674
18441
  }
@@ -17946,7 +18713,7 @@ function tighten_body(statements, compressor) {
17946
18713
  return false;
17947
18714
  for (var j = i + 1, len = statements.length; j < len; j++) {
17948
18715
  var stat = statements[j];
17949
- if (stat instanceof AST_Const || stat instanceof AST_Let)
18716
+ if (stat instanceof AST_DefinitionsLike && !(stat instanceof AST_Var))
17950
18717
  return false;
17951
18718
  }
17952
18719
  var lct = ab instanceof AST_LoopControl ? compressor.loopcontrol_target(ab) : null;
@@ -18035,7 +18802,7 @@ function tighten_body(statements, compressor) {
18035
18802
  CHANGED = n != len;
18036
18803
  if (has_quit)
18037
18804
  has_quit.forEach(function (stat) {
18038
- trim_unreachable_code(compressor, stat, statements);
18805
+ extract_from_unreachable_code(compressor, stat, statements);
18039
18806
  });
18040
18807
  }
18041
18808
 
@@ -18086,7 +18853,7 @@ function tighten_body(statements, compressor) {
18086
18853
  var line = block.body[i];
18087
18854
  if (line instanceof AST_Var && declarations_only(line)) {
18088
18855
  decls.push(line);
18089
- } else if (stat || line instanceof AST_Const || line instanceof AST_Let) {
18856
+ } else if (stat || line instanceof AST_DefinitionsLike && !(line instanceof AST_Var)) {
18090
18857
  return false;
18091
18858
  } else {
18092
18859
  stat = line;
@@ -18107,9 +18874,9 @@ function tighten_body(statements, compressor) {
18107
18874
  var stat = statements[i];
18108
18875
  if (prev) {
18109
18876
  if (stat instanceof AST_Exit) {
18110
- stat.value = cons_seq(stat.value || make_node(AST_Undefined, stat).transform(compressor));
18877
+ stat.value = cons_seq(stat.value || make_void_0(stat).transform(compressor));
18111
18878
  } else if (stat instanceof AST_For) {
18112
- if (!(stat.init instanceof AST_Definitions)) {
18879
+ if (!(stat.init instanceof AST_DefinitionsLike)) {
18113
18880
  const abort = walk(prev.body, node => {
18114
18881
  if (node instanceof AST_Scope)
18115
18882
  return true;
@@ -18129,7 +18896,7 @@ function tighten_body(statements, compressor) {
18129
18896
  }
18130
18897
  }
18131
18898
  } else if (stat instanceof AST_ForIn) {
18132
- if (!(stat.init instanceof AST_Const) && !(stat.init instanceof AST_Let)) {
18899
+ if (!(stat.init instanceof AST_DefinitionsLike) || stat.init instanceof AST_Var) {
18133
18900
  stat.object = cons_seq(stat.object);
18134
18901
  }
18135
18902
  } else if (stat instanceof AST_If) {
@@ -18246,6 +19013,12 @@ function tighten_body(statements, compressor) {
18246
19013
  statements[++j] = stat;
18247
19014
  defs = stat;
18248
19015
  }
19016
+ } else if (
19017
+ stat instanceof AST_Using
19018
+ && prev instanceof AST_Using
19019
+ && prev.await === stat.await
19020
+ ) {
19021
+ prev.definitions = prev.definitions.concat(stat.definitions);
18249
19022
  } else if (stat instanceof AST_Exit) {
18250
19023
  stat.value = extract_object_assignments(stat.value);
18251
19024
  } else if (stat instanceof AST_For) {
@@ -18605,7 +19378,7 @@ function inline_into_call(self, compressor) {
18605
19378
  if (returned) {
18606
19379
  returned = returned.clone(true);
18607
19380
  } else {
18608
- returned = make_node(AST_Undefined, self);
19381
+ returned = make_void_0(self);
18609
19382
  }
18610
19383
  const args = self.args.concat(returned);
18611
19384
  return make_sequence(self, args).optimize(compressor);
@@ -18621,7 +19394,7 @@ function inline_into_call(self, compressor) {
18621
19394
  && returned.name === fn.argnames[0].name
18622
19395
  ) {
18623
19396
  const replacement =
18624
- (self.args[0] || make_node(AST_Undefined)).optimize(compressor);
19397
+ (self.args[0] || make_void_0()).optimize(compressor);
18625
19398
 
18626
19399
  let parent;
18627
19400
  if (
@@ -18703,7 +19476,7 @@ function inline_into_call(self, compressor) {
18703
19476
 
18704
19477
  const can_drop_this_call = is_regular_func && compressor.option("side_effects") && fn.body.every(is_empty);
18705
19478
  if (can_drop_this_call) {
18706
- var args = self.args.concat(make_node(AST_Undefined, self));
19479
+ var args = self.args.concat(make_void_0(self));
18707
19480
  return make_sequence(self, args).optimize(compressor);
18708
19481
  }
18709
19482
 
@@ -18722,9 +19495,9 @@ function inline_into_call(self, compressor) {
18722
19495
  return self;
18723
19496
 
18724
19497
  function return_value(stat) {
18725
- if (!stat) return make_node(AST_Undefined, self);
19498
+ if (!stat) return make_void_0(self);
18726
19499
  if (stat instanceof AST_Return) {
18727
- if (!stat.value) return make_node(AST_Undefined, self);
19500
+ if (!stat.value) return make_void_0(self);
18728
19501
  return stat.value.clone(true);
18729
19502
  }
18730
19503
  if (stat instanceof AST_SimpleStatement) {
@@ -18870,7 +19643,7 @@ function inline_into_call(self, compressor) {
18870
19643
  } else {
18871
19644
  var symbol = make_node(AST_SymbolVar, name, name);
18872
19645
  name.definition().orig.push(symbol);
18873
- if (!value && in_loop) value = make_node(AST_Undefined, self);
19646
+ if (!value && in_loop) value = make_void_0(self);
18874
19647
  append_var(decls, expressions, symbol, value);
18875
19648
  }
18876
19649
  }
@@ -18897,7 +19670,7 @@ function inline_into_call(self, compressor) {
18897
19670
  operator: "=",
18898
19671
  logical: false,
18899
19672
  left: sym,
18900
- right: make_node(AST_Undefined, name)
19673
+ right: make_void_0(name),
18901
19674
  }));
18902
19675
  }
18903
19676
  }
@@ -19066,6 +19839,8 @@ class Compressor extends TreeWalker {
19066
19839
  drop_console : false,
19067
19840
  drop_debugger : !false_by_default,
19068
19841
  ecma : 5,
19842
+ builtins_ecma : 5,
19843
+ builtins_pure : false,
19069
19844
  evaluate : !false_by_default,
19070
19845
  expression : false,
19071
19846
  global_defs : false,
@@ -19161,6 +19936,12 @@ class Compressor extends TreeWalker {
19161
19936
  this._mangle_options = mangle_options
19162
19937
  ? format_mangler_options(mangle_options)
19163
19938
  : mangle_options;
19939
+
19940
+ this.pure_access_globals = pure_access_globals(this);
19941
+ this.is_pure_native_fn = is_pure_native_fn(this);
19942
+ this.is_pure_native_method = is_pure_native_method(this);
19943
+ this.is_pure_native_static_fn = is_pure_native_static_fn(this);
19944
+ this.is_pure_native_static_property = is_pure_native_static_property(this);
19164
19945
  }
19165
19946
 
19166
19947
  mangle_options() {
@@ -19210,6 +19991,11 @@ class Compressor extends TreeWalker {
19210
19991
  }
19211
19992
  }
19212
19993
 
19994
+ /** True if compressor.self()'s result will be turned into a 32-bit integer.
19995
+ * ex:
19996
+ * ~{expr}
19997
+ * (1, 2, {expr}) | 0
19998
+ **/
19213
19999
  in_32_bit_context(other_operand_must_be_number) {
19214
20000
  if (!this.option("evaluate")) return false;
19215
20001
  var self = this.self();
@@ -19227,9 +20013,10 @@ class Compressor extends TreeWalker {
19227
20013
  if (
19228
20014
  p instanceof AST_Binary
19229
20015
  && (
19230
- p.operator == "&&"
19231
- || p.operator == "||"
19232
- || p.operator == "??"
20016
+ // Don't talk about p.left. Can change branch taken
20017
+ p.operator == "&&" && p.right === self
20018
+ || p.operator == "||" && p.right === self
20019
+ || p.operator == "??" && p.right === self
19233
20020
  )
19234
20021
  || p instanceof AST_Conditional && p.condition !== self
19235
20022
  || p.tail_node() === self
@@ -19388,7 +20175,7 @@ AST_Toplevel.DEFMETHOD("drop_console", function(options) {
19388
20175
  set_flag(exp.expression, SQUEEZED);
19389
20176
  self.args = [];
19390
20177
  } else {
19391
- return make_node(AST_Undefined, self);
20178
+ return make_void_0(self);
19392
20179
  }
19393
20180
  }
19394
20181
  });
@@ -19416,12 +20203,7 @@ AST_Scope.DEFMETHOD("process_expression", function(insert, compressor) {
19416
20203
  : make_node(AST_EmptyStatement, node);
19417
20204
  }
19418
20205
  return make_node(AST_SimpleStatement, node, {
19419
- body: node.value || make_node(AST_UnaryPrefix, node, {
19420
- operator: "void",
19421
- expression: make_node(AST_Number, node, {
19422
- value: 0
19423
- })
19424
- })
20206
+ body: node.value || make_void_0(node)
19425
20207
  });
19426
20208
  }
19427
20209
  if (node instanceof AST_Class || node instanceof AST_Lambda && node !== self) {
@@ -19494,10 +20276,9 @@ function find_variable(compressor, name) {
19494
20276
  return scope.find_variable(name);
19495
20277
  }
19496
20278
 
19497
- var global_names = makePredicate("Array Boolean clearInterval clearTimeout console Date decodeURI decodeURIComponent encodeURI encodeURIComponent Error escape eval EvalError Function isFinite isNaN JSON Math Number parseFloat parseInt RangeError ReferenceError RegExp Object setInterval setTimeout String SyntaxError TypeError unescape URIError");
19498
20279
  AST_SymbolRef.DEFMETHOD("is_declared", function(compressor) {
19499
20280
  return !this.definition().undeclared
19500
- || compressor.option("unsafe") && global_names.has(this.name);
20281
+ || (compressor.option("unsafe") || compressor.option("builtins_pure")) && compressor.pure_access_globals(this.name);
19501
20282
  });
19502
20283
 
19503
20284
  /* -----[ optimizers ]----- */
@@ -19534,6 +20315,7 @@ function can_be_extracted_from_if_block(node) {
19534
20315
  return !(
19535
20316
  node instanceof AST_Const
19536
20317
  || node instanceof AST_Let
20318
+ || node instanceof AST_Using
19537
20319
  || node instanceof AST_Class
19538
20320
  );
19539
20321
  }
@@ -19712,6 +20494,7 @@ AST_Scope.DEFMETHOD("hoist_properties", function(compressor) {
19712
20494
  let def;
19713
20495
  let value;
19714
20496
  if (sym.scope === self
20497
+ && !(sym instanceof AST_SymbolUsing)
19715
20498
  && (def = sym.definition()).escaped != 1
19716
20499
  && !def.assignments
19717
20500
  && !def.direct_access
@@ -19830,7 +20613,7 @@ function if_break_in_loop(self, compressor) {
19830
20613
  body: self.condition
19831
20614
  }));
19832
20615
  }
19833
- trim_unreachable_code(compressor, self.body, body);
20616
+ extract_from_unreachable_code(compressor, self.body, body);
19834
20617
  return make_node(AST_BlockStatement, self, {
19835
20618
  body: body
19836
20619
  });
@@ -19901,7 +20684,7 @@ def_optimize(AST_For, function(self, compressor) {
19901
20684
  if (cond instanceof AST_Node) cond = self.condition.tail_node().evaluate(compressor);
19902
20685
  if (!cond) {
19903
20686
  var body = [];
19904
- trim_unreachable_code(compressor, self.body, body);
20687
+ extract_from_unreachable_code(compressor, self.body, body);
19905
20688
  if (self.init instanceof AST_Statement) {
19906
20689
  body.push(self.init);
19907
20690
  } else if (self.init) {
@@ -19937,7 +20720,7 @@ def_optimize(AST_If, function(self, compressor) {
19937
20720
  if (cond instanceof AST_Node) cond = self.condition.tail_node().evaluate(compressor);
19938
20721
  if (!cond) {
19939
20722
  var body = [];
19940
- trim_unreachable_code(compressor, self.body, body);
20723
+ extract_from_unreachable_code(compressor, self.body, body);
19941
20724
  body.push(make_node(AST_SimpleStatement, self.condition, {
19942
20725
  body: self.condition
19943
20726
  }));
@@ -19950,7 +20733,7 @@ def_optimize(AST_If, function(self, compressor) {
19950
20733
  }));
19951
20734
  body.push(self.body);
19952
20735
  if (self.alternative) {
19953
- trim_unreachable_code(compressor, self.alternative, body);
20736
+ extract_from_unreachable_code(compressor, self.alternative, body);
19954
20737
  }
19955
20738
  return make_node(AST_BlockStatement, self, { body: body }).optimize(compressor);
19956
20739
  }
@@ -20022,8 +20805,8 @@ def_optimize(AST_If, function(self, compressor) {
20022
20805
  return make_node(self.body.CTOR, self, {
20023
20806
  value: make_node(AST_Conditional, self, {
20024
20807
  condition : self.condition,
20025
- consequent : self.body.value || make_node(AST_Undefined, self.body),
20026
- alternative : self.alternative.value || make_node(AST_Undefined, self.alternative)
20808
+ consequent : self.body.value || make_void_0(self.body),
20809
+ alternative : self.alternative.value || make_void_0(self.alternative),
20027
20810
  }).transform(compressor)
20028
20811
  }).optimize(compressor);
20029
20812
  }
@@ -20078,6 +20861,9 @@ def_optimize(AST_Switch, function(self, compressor) {
20078
20861
  var body = [];
20079
20862
  var default_branch;
20080
20863
  var exact_match;
20864
+ // - compress self.body into `body`
20865
+ // - find and deduplicate default branch
20866
+ // - find the exact match (`case 1234` inside `switch(1234)`)
20081
20867
  for (var i = 0, len = self.body.length; i < len && !exact_match; i++) {
20082
20868
  branch = self.body[i];
20083
20869
  if (branch instanceof AST_Default) {
@@ -20107,6 +20893,7 @@ def_optimize(AST_Switch, function(self, compressor) {
20107
20893
  }
20108
20894
  body.push(branch);
20109
20895
  }
20896
+ // i < len if we found an exact_match. eliminate the rest
20110
20897
  while (i < len) eliminate_branch(self.body[i++], body[body.length - 1]);
20111
20898
  self.body = body;
20112
20899
 
@@ -20178,7 +20965,7 @@ def_optimize(AST_Switch, function(self, compressor) {
20178
20965
  let i = body.length - 1;
20179
20966
  for (; i >= 0; i--) {
20180
20967
  let bbody = body[i].body;
20181
- if (is_break(bbody[bbody.length - 1], compressor)) bbody.pop();
20968
+ while (is_break(bbody[bbody.length - 1], compressor)) bbody.pop();
20182
20969
  if (!is_inert_body(body[i])) break;
20183
20970
  }
20184
20971
  // i now points to the index of a branch that contains a body. By incrementing, it's
@@ -20194,9 +20981,9 @@ def_optimize(AST_Switch, function(self, compressor) {
20194
20981
  let branch = body[j];
20195
20982
  if (branch === default_or_exact) {
20196
20983
  default_or_exact = null;
20197
- body.pop();
20984
+ eliminate_branch(body.pop());
20198
20985
  } else if (!branch.expression.has_side_effects(compressor)) {
20199
- body.pop();
20986
+ eliminate_branch(body.pop());
20200
20987
  } else {
20201
20988
  break;
20202
20989
  }
@@ -20310,15 +21097,16 @@ def_optimize(AST_Switch, function(self, compressor) {
20310
21097
  // and there's a side-effect somewhere. Just let the below paths take care of it.
20311
21098
  }
20312
21099
 
21100
+ // Reintegrate `decl` (var statements)
20313
21101
  if (body.length > 0) {
20314
21102
  body[0].body = decl.concat(body[0].body);
20315
21103
  }
20316
-
20317
21104
  if (body.length == 0) {
20318
21105
  return make_node(AST_BlockStatement, self, {
20319
21106
  body: decl.concat(statement(self.expression))
20320
21107
  }).optimize(compressor);
20321
21108
  }
21109
+
20322
21110
  if (body.length == 1 && !has_nested_break(self)) {
20323
21111
  // This is the last case body, and we've already pruned any breaks, so it's
20324
21112
  // safe to hoist.
@@ -20398,7 +21186,7 @@ def_optimize(AST_Switch, function(self, compressor) {
20398
21186
  if (prev && !aborts(prev)) {
20399
21187
  prev.body = prev.body.concat(branch.body);
20400
21188
  } else {
20401
- trim_unreachable_code(compressor, branch, decl);
21189
+ extract_from_unreachable_code(compressor, branch, decl);
20402
21190
  }
20403
21191
  }
20404
21192
  function branches_equivalent(branch, prev, insertBreak) {
@@ -20452,7 +21240,7 @@ def_optimize(AST_Try, function(self, compressor) {
20452
21240
  if (compressor.option("dead_code") && self.body.body.every(is_empty)) {
20453
21241
  var body = [];
20454
21242
  if (self.bcatch) {
20455
- trim_unreachable_code(compressor, self.bcatch, body);
21243
+ extract_from_unreachable_code(compressor, self.bcatch, body);
20456
21244
  }
20457
21245
  if (self.bfinally) body.push(...self.bfinally.body);
20458
21246
  return make_node(AST_BlockStatement, self, {
@@ -20571,7 +21359,7 @@ def_optimize(AST_Call, function(self, compressor) {
20571
21359
  const value = condition.evaluate(compressor);
20572
21360
 
20573
21361
  if (value === 1 || value === true) {
20574
- return make_node(AST_Undefined, self);
21362
+ return make_void_0(self).optimize(compressor);
20575
21363
  }
20576
21364
  }
20577
21365
  }
@@ -20933,6 +21721,10 @@ def_optimize(AST_UnaryPrefix, function(self, compressor) {
20933
21721
  ) {
20934
21722
  return make_sequence(self, [e, make_node(AST_True, self)]).optimize(compressor);
20935
21723
  }
21724
+ // Short-circuit common `void 0`
21725
+ if (self.operator === "void" && e instanceof AST_Number && e.value === 0) {
21726
+ return unsafe_undefined_ref(self, compressor) || self;
21727
+ }
20936
21728
  var seq = self.lift_sequences(compressor);
20937
21729
  if (seq !== self) {
20938
21730
  return seq;
@@ -20943,7 +21735,7 @@ def_optimize(AST_UnaryPrefix, function(self, compressor) {
20943
21735
  self.expression = e;
20944
21736
  return self;
20945
21737
  } else {
20946
- return make_node(AST_Undefined, self).optimize(compressor);
21738
+ return make_void_0(self).optimize(compressor);
20947
21739
  }
20948
21740
  }
20949
21741
  if (compressor.in_boolean_context()) {
@@ -21129,7 +21921,7 @@ def_optimize(AST_Binary, function(self, compressor) {
21129
21921
  if (expr instanceof AST_SymbolRef ? expr.is_declared(compressor)
21130
21922
  : !(expr instanceof AST_PropAccess && compressor.option("ie8"))) {
21131
21923
  self.right = expr;
21132
- self.left = make_node(AST_Undefined, self.left).optimize(compressor);
21924
+ self.left = make_void_0(self.left).optimize(compressor);
21133
21925
  if (self.operator.length == 2) self.operator += "=";
21134
21926
  }
21135
21927
  } else if (compressor.option("typeofs")
@@ -21142,7 +21934,7 @@ def_optimize(AST_Binary, function(self, compressor) {
21142
21934
  if (expr instanceof AST_SymbolRef ? expr.is_declared(compressor)
21143
21935
  : !(expr instanceof AST_PropAccess && compressor.option("ie8"))) {
21144
21936
  self.left = expr;
21145
- self.right = make_node(AST_Undefined, self.right).optimize(compressor);
21937
+ self.right = make_void_0(self.right).optimize(compressor);
21146
21938
  if (self.operator.length == 2) self.operator += "=";
21147
21939
  }
21148
21940
  } else if (self.left instanceof AST_SymbolRef
@@ -21783,7 +22575,8 @@ function is_atomic(lhs, self) {
21783
22575
  return lhs instanceof AST_SymbolRef || lhs.TYPE === self.TYPE;
21784
22576
  }
21785
22577
 
21786
- def_optimize(AST_Undefined, function(self, compressor) {
22578
+ /** Apply the `unsafe_undefined` option: find a variable called `undefined` and turn `self` into a reference to it. */
22579
+ function unsafe_undefined_ref(self, compressor) {
21787
22580
  if (compressor.option("unsafe_undefined")) {
21788
22581
  var undef = find_variable(compressor, "undefined");
21789
22582
  if (undef) {
@@ -21796,14 +22589,15 @@ def_optimize(AST_Undefined, function(self, compressor) {
21796
22589
  return ref;
21797
22590
  }
21798
22591
  }
22592
+ return null;
22593
+ }
22594
+
22595
+ def_optimize(AST_Undefined, function(self, compressor) {
22596
+ var symbolref = unsafe_undefined_ref(self, compressor);
22597
+ if (symbolref) return symbolref;
21799
22598
  var lhs = compressor.is_lhs();
21800
22599
  if (lhs && is_atomic(lhs, self)) return self;
21801
- return make_node(AST_UnaryPrefix, self, {
21802
- operator: "void",
21803
- expression: make_node(AST_Number, self, {
21804
- value: 0
21805
- })
21806
- });
22600
+ return make_void_0(self);
21807
22601
  });
21808
22602
 
21809
22603
  def_optimize(AST_Infinity, function(self, compressor) {
@@ -22490,7 +23284,7 @@ def_optimize(AST_Sub, function(self, compressor) {
22490
23284
  }
22491
23285
  }
22492
23286
  if (retValue instanceof AST_Expansion) break FLATTEN;
22493
- retValue = retValue instanceof AST_Hole ? make_node(AST_Undefined, retValue) : retValue;
23287
+ retValue = retValue instanceof AST_Hole ? make_void_0(retValue) : retValue;
22494
23288
  if (!flatten) values.unshift(retValue);
22495
23289
  while (--i >= 0) {
22496
23290
  var value = elements[i];
@@ -22529,7 +23323,7 @@ def_optimize(AST_Chain, function (self, compressor) {
22529
23323
  if (parent instanceof AST_UnaryPrefix && parent.operator === "delete") {
22530
23324
  return make_node_from_constant(0, self);
22531
23325
  }
22532
- return make_node(AST_Undefined, self);
23326
+ return make_void_0(self).optimize(compressor);
22533
23327
  }
22534
23328
  if (
22535
23329
  self.expression instanceof AST_PropAccess
@@ -23277,6 +24071,7 @@ var domprops = [
23277
24071
  "Array",
23278
24072
  "ArrayBuffer",
23279
24073
  "ArrayType",
24074
+ "AsyncDisposableStack",
23280
24075
  "Atomics",
23281
24076
  "Attr",
23282
24077
  "Audio",
@@ -23415,6 +24210,7 @@ var domprops = [
23415
24210
  "COPY_WRITE_BUFFER",
23416
24211
  "COPY_WRITE_BUFFER_BINDING",
23417
24212
  "COUNTER_STYLE_RULE",
24213
+ "CSPViolationReportBody",
23418
24214
  "CSS",
23419
24215
  "CSS2Properties",
23420
24216
  "CSSAnimation",
@@ -23425,6 +24221,9 @@ var domprops = [
23425
24221
  "CSSFontFaceRule",
23426
24222
  "CSSFontFeatureValuesRule",
23427
24223
  "CSSFontPaletteValuesRule",
24224
+ "CSSFunctionDeclarations",
24225
+ "CSSFunctionDescriptors",
24226
+ "CSSFunctionRule",
23428
24227
  "CSSGroupingRule",
23429
24228
  "CSSImageValue",
23430
24229
  "CSSImportRule",
@@ -23468,6 +24267,7 @@ var domprops = [
23468
24267
  "CSSSkewY",
23469
24268
  "CSSStartingStyleRule",
23470
24269
  "CSSStyleDeclaration",
24270
+ "CSSStyleProperties",
23471
24271
  "CSSStyleRule",
23472
24272
  "CSSStyleSheet",
23473
24273
  "CSSStyleValue",
@@ -23601,6 +24401,7 @@ var domprops = [
23601
24401
  "CookieStoreManager",
23602
24402
  "CountQueuingStrategy",
23603
24403
  "Counter",
24404
+ "CreateMonitor",
23604
24405
  "CreateType",
23605
24406
  "Credential",
23606
24407
  "CredentialsContainer",
@@ -24110,11 +24911,14 @@ var domprops = [
24110
24911
  "DeviceMotionEventAcceleration",
24111
24912
  "DeviceMotionEventRotationRate",
24112
24913
  "DeviceOrientationEvent",
24914
+ "DevicePosture",
24113
24915
  "DeviceProximityEvent",
24114
24916
  "DeviceStorage",
24115
24917
  "DeviceStorageChangeEvent",
24918
+ "DigitalCredential",
24116
24919
  "Directory",
24117
24920
  "DisplayNames",
24921
+ "DisposableStack",
24118
24922
  "Document",
24119
24923
  "DocumentFragment",
24120
24924
  "DocumentPictureInPicture",
@@ -24122,6 +24926,7 @@ var domprops = [
24122
24926
  "DocumentTimeline",
24123
24927
  "DocumentType",
24124
24928
  "DragEvent",
24929
+ "Duration",
24125
24930
  "DurationFormat",
24126
24931
  "DynamicsCompressorNode",
24127
24932
  "E",
@@ -24229,6 +25034,7 @@ var domprops = [
24229
25034
  "FeedEntry",
24230
25035
  "Fence",
24231
25036
  "FencedFrameConfig",
25037
+ "FetchLaterResult",
24232
25038
  "File",
24233
25039
  "FileError",
24234
25040
  "FileList",
@@ -24241,6 +25047,7 @@ var domprops = [
24241
25047
  "FileSystemFileEntry",
24242
25048
  "FileSystemFileHandle",
24243
25049
  "FileSystemHandle",
25050
+ "FileSystemObserver",
24244
25051
  "FileSystemWritableFileStream",
24245
25052
  "FinalizationRegistry",
24246
25053
  "FindInPage",
@@ -24406,6 +25213,7 @@ var domprops = [
24406
25213
  "HTMLQuoteElement",
24407
25214
  "HTMLScriptElement",
24408
25215
  "HTMLSelectElement",
25216
+ "HTMLSelectedContentElement",
24409
25217
  "HTMLShadowElement",
24410
25218
  "HTMLSlotElement",
24411
25219
  "HTMLSourceElement",
@@ -24450,6 +25258,7 @@ var domprops = [
24450
25258
  "IDBMutableFile",
24451
25259
  "IDBObjectStore",
24452
25260
  "IDBOpenDBRequest",
25261
+ "IDBRecord",
24453
25262
  "IDBRequest",
24454
25263
  "IDBTransaction",
24455
25264
  "IDBVersionChangeEvent",
@@ -24512,10 +25321,13 @@ var domprops = [
24512
25321
  "InstallTrigger",
24513
25322
  "InstallTriggerImpl",
24514
25323
  "Instance",
25324
+ "Instant",
24515
25325
  "Int16Array",
24516
25326
  "Int32Array",
24517
25327
  "Int8Array",
25328
+ "IntegrityViolationReportBody",
24518
25329
  "Intent",
25330
+ "InterestEvent",
24519
25331
  "InternalError",
24520
25332
  "IntersectionObserver",
24521
25333
  "IntersectionObserverEntry",
@@ -24565,6 +25377,7 @@ var domprops = [
24565
25377
  "LUMINANCE",
24566
25378
  "LUMINANCE_ALPHA",
24567
25379
  "LanguageCode",
25380
+ "LanguageDetector",
24568
25381
  "LargestContentfulPaint",
24569
25382
  "LaunchParams",
24570
25383
  "LaunchQueue",
@@ -24894,6 +25707,7 @@ var domprops = [
24894
25707
  "NavigationCurrentEntryChangeEvent",
24895
25708
  "NavigationDestination",
24896
25709
  "NavigationHistoryEntry",
25710
+ "NavigationPrecommitController",
24897
25711
  "NavigationPreloadManager",
24898
25712
  "NavigationTransition",
24899
25713
  "Navigator",
@@ -24911,6 +25725,7 @@ var domprops = [
24911
25725
  "Notation",
24912
25726
  "Notification",
24913
25727
  "NotifyPaintEvent",
25728
+ "Now",
24914
25729
  "Number",
24915
25730
  "NumberFormat",
24916
25731
  "OBJECT_TYPE",
@@ -24932,6 +25747,7 @@ var domprops = [
24932
25747
  "OTPCredential",
24933
25748
  "OUT_OF_MEMORY",
24934
25749
  "Object",
25750
+ "Observable",
24935
25751
  "OfflineAudioCompletionEvent",
24936
25752
  "OfflineAudioContext",
24937
25753
  "OfflineResourceList",
@@ -25033,6 +25849,11 @@ var domprops = [
25033
25849
  "PhotoCapabilities",
25034
25850
  "PictureInPictureEvent",
25035
25851
  "PictureInPictureWindow",
25852
+ "PlainDate",
25853
+ "PlainDateTime",
25854
+ "PlainMonthDay",
25855
+ "PlainTime",
25856
+ "PlainYearMonth",
25036
25857
  "PlatformArch",
25037
25858
  "PlatformInfo",
25038
25859
  "PlatformNaclArch",
@@ -25073,6 +25894,7 @@ var domprops = [
25073
25894
  "QUOTA_ERR",
25074
25895
  "QUOTA_EXCEEDED_ERR",
25075
25896
  "QueryInterface",
25897
+ "QuotaExceededError",
25076
25898
  "R11F_G11F_B10F",
25077
25899
  "R16F",
25078
25900
  "R16I",
@@ -25213,6 +26035,7 @@ var domprops = [
25213
26035
  "ResizeObserverEntry",
25214
26036
  "ResizeObserverSize",
25215
26037
  "Response",
26038
+ "RestrictionTarget",
25216
26039
  "RuntimeError",
25217
26040
  "SAMPLER_2D",
25218
26041
  "SAMPLER_2D_ARRAY",
@@ -25619,6 +26442,11 @@ var domprops = [
25619
26442
  "ShadowRoot",
25620
26443
  "SharedArrayBuffer",
25621
26444
  "SharedStorage",
26445
+ "SharedStorageAppendMethod",
26446
+ "SharedStorageClearMethod",
26447
+ "SharedStorageDeleteMethod",
26448
+ "SharedStorageModifierMethod",
26449
+ "SharedStorageSetMethod",
25622
26450
  "SharedStorageWorklet",
25623
26451
  "SharedWorker",
25624
26452
  "SharingState",
@@ -25626,6 +26454,12 @@ var domprops = [
25626
26454
  "SnapEvent",
25627
26455
  "SourceBuffer",
25628
26456
  "SourceBufferList",
26457
+ "SpeechGrammar",
26458
+ "SpeechGrammarList",
26459
+ "SpeechRecognition",
26460
+ "SpeechRecognitionErrorEvent",
26461
+ "SpeechRecognitionEvent",
26462
+ "SpeechRecognitionPhrase",
25629
26463
  "SpeechSynthesis",
25630
26464
  "SpeechSynthesisErrorEvent",
25631
26465
  "SpeechSynthesisEvent",
@@ -25646,7 +26480,12 @@ var domprops = [
25646
26480
  "StyleSheet",
25647
26481
  "StyleSheetList",
25648
26482
  "SubmitEvent",
26483
+ "Subscriber",
25649
26484
  "SubtleCrypto",
26485
+ "Summarizer",
26486
+ "SuppressedError",
26487
+ "SuspendError",
26488
+ "Suspending",
25650
26489
  "Symbol",
25651
26490
  "SyncManager",
25652
26491
  "SyntaxError",
@@ -25757,6 +26596,7 @@ var domprops = [
25757
26596
  "TaskController",
25758
26597
  "TaskPriorityChangeEvent",
25759
26598
  "TaskSignal",
26599
+ "Temporal",
25760
26600
  "Text",
25761
26601
  "TextDecoder",
25762
26602
  "TextDecoderStream",
@@ -25781,6 +26621,7 @@ var domprops = [
25781
26621
  "TransformStream",
25782
26622
  "TransformStreamDefaultController",
25783
26623
  "TransitionEvent",
26624
+ "Translator",
25784
26625
  "TreeWalker",
25785
26626
  "TrustedHTML",
25786
26627
  "TrustedScript",
@@ -25925,6 +26766,7 @@ var domprops = [
25925
26766
  "ViewTransition",
25926
26767
  "ViewTransitionTypeSet",
25927
26768
  "ViewType",
26769
+ "Viewport",
25928
26770
  "VirtualKeyboard",
25929
26771
  "VirtualKeyboardGeometryChangeEvent",
25930
26772
  "VisibilityStateEntry",
@@ -26134,6 +26976,7 @@ var domprops = [
26134
26976
  "XRWebGLLayer",
26135
26977
  "XSLTProcessor",
26136
26978
  "ZERO",
26979
+ "ZonedDateTime",
26137
26980
  "ZoomSettings",
26138
26981
  "ZoomSettingsMode",
26139
26982
  "ZoomSettingsScope",
@@ -26183,6 +27026,7 @@ var domprops = [
26183
27026
  "activeSourceCount",
26184
27027
  "activeTexture",
26185
27028
  "activeVRDisplays",
27029
+ "activeViewTransition",
26186
27030
  "activityLog",
26187
27031
  "actualBoundingBoxAscent",
26188
27032
  "actualBoundingBoxDescent",
@@ -26190,6 +27034,7 @@ var domprops = [
26190
27034
  "actualBoundingBoxRight",
26191
27035
  "adAuctionComponents",
26192
27036
  "adAuctionHeaders",
27037
+ "adapterInfo",
26193
27038
  "add",
26194
27039
  "addAll",
26195
27040
  "addBehavior",
@@ -26215,6 +27060,7 @@ var domprops = [
26215
27060
  "addSearchEngine",
26216
27061
  "addSourceBuffer",
26217
27062
  "addStream",
27063
+ "addTeardown",
26218
27064
  "addTextTrack",
26219
27065
  "addTrack",
26220
27066
  "addTransceiver",
@@ -26229,6 +27075,7 @@ var domprops = [
26229
27075
  "addressModeU",
26230
27076
  "addressModeV",
26231
27077
  "addressModeW",
27078
+ "adopt",
26232
27079
  "adoptNode",
26233
27080
  "adoptedCallback",
26234
27081
  "adoptedStyleSheets",
@@ -26276,8 +27123,10 @@ var domprops = [
26276
27123
  "amplitude",
26277
27124
  "ancestorOrigins",
26278
27125
  "anchor",
27126
+ "anchorName",
26279
27127
  "anchorNode",
26280
27128
  "anchorOffset",
27129
+ "anchorScope",
26281
27130
  "anchorSpace",
26282
27131
  "anchors",
26283
27132
  "and",
@@ -26313,6 +27162,7 @@ var domprops = [
26313
27162
  "animationTimingFunction",
26314
27163
  "animationsPaused",
26315
27164
  "anniversary",
27165
+ "annotation",
26316
27166
  "antialias",
26317
27167
  "anticipatedRemoval",
26318
27168
  "any",
@@ -26347,6 +27197,7 @@ var domprops = [
26347
27197
  "archive",
26348
27198
  "areas",
26349
27199
  "arguments",
27200
+ "ariaActiveDescendantElement",
26350
27201
  "ariaAtomic",
26351
27202
  "ariaAutoComplete",
26352
27203
  "ariaBrailleLabel",
@@ -26357,21 +27208,29 @@ var domprops = [
26357
27208
  "ariaColIndex",
26358
27209
  "ariaColIndexText",
26359
27210
  "ariaColSpan",
27211
+ "ariaControlsElements",
26360
27212
  "ariaCurrent",
27213
+ "ariaDescribedByElements",
26361
27214
  "ariaDescription",
27215
+ "ariaDetailsElements",
26362
27216
  "ariaDisabled",
27217
+ "ariaErrorMessageElements",
26363
27218
  "ariaExpanded",
27219
+ "ariaFlowToElements",
26364
27220
  "ariaHasPopup",
26365
27221
  "ariaHidden",
26366
27222
  "ariaInvalid",
26367
27223
  "ariaKeyShortcuts",
26368
27224
  "ariaLabel",
27225
+ "ariaLabelledByElements",
26369
27226
  "ariaLevel",
26370
27227
  "ariaLive",
26371
27228
  "ariaModal",
26372
27229
  "ariaMultiLine",
26373
27230
  "ariaMultiSelectable",
27231
+ "ariaNotify",
26374
27232
  "ariaOrientation",
27233
+ "ariaOwnsElements",
26375
27234
  "ariaPlaceholder",
26376
27235
  "ariaPosInSet",
26377
27236
  "ariaPressed",
@@ -26514,6 +27373,7 @@ var domprops = [
26514
27373
  "baseline-source",
26515
27374
  "baselineShift",
26516
27375
  "baselineSource",
27376
+ "batchUpdate",
26517
27377
  "battery",
26518
27378
  "bday",
26519
27379
  "before",
@@ -26566,6 +27426,7 @@ var domprops = [
26566
27426
  "blockDirection",
26567
27427
  "blockSize",
26568
27428
  "blockedURI",
27429
+ "blockedURL",
26569
27430
  "blocking",
26570
27431
  "blockingDuration",
26571
27432
  "blue",
@@ -26576,6 +27437,7 @@ var domprops = [
26576
27437
  "bold",
26577
27438
  "bookmarks",
26578
27439
  "booleanValue",
27440
+ "boost",
26579
27441
  "border",
26580
27442
  "border-block",
26581
27443
  "border-block-color",
@@ -26712,6 +27574,7 @@ var domprops = [
26712
27574
  "boundingWidth",
26713
27575
  "bounds",
26714
27576
  "boundsGeometry",
27577
+ "box",
26715
27578
  "box-decoration-break",
26716
27579
  "box-shadow",
26717
27580
  "box-sizing",
@@ -26757,6 +27620,7 @@ var domprops = [
26757
27620
  "c",
26758
27621
  "cache",
26759
27622
  "caches",
27623
+ "calendar",
26760
27624
  "call",
26761
27625
  "caller",
26762
27626
  "camera",
@@ -26811,6 +27675,7 @@ var domprops = [
26811
27675
  "cast",
26812
27676
  "catch",
26813
27677
  "category",
27678
+ "cause",
26814
27679
  "cbrt",
26815
27680
  "cd",
26816
27681
  "ceil",
@@ -26841,6 +27706,7 @@ var domprops = [
26841
27706
  "characterData",
26842
27707
  "characterDataOldValue",
26843
27708
  "characterSet",
27709
+ "characterVariant",
26844
27710
  "characteristic",
26845
27711
  "charging",
26846
27712
  "chargingTime",
@@ -26927,6 +27793,7 @@ var domprops = [
26927
27793
  "closeCode",
26928
27794
  "closePath",
26929
27795
  "closed",
27796
+ "closedBy",
26930
27797
  "closest",
26931
27798
  "clz",
26932
27799
  "clz32",
@@ -26984,11 +27851,13 @@ var domprops = [
26984
27851
  "columnWidth",
26985
27852
  "columns",
26986
27853
  "command",
27854
+ "commandForElement",
26987
27855
  "commands",
26988
27856
  "commit",
26989
27857
  "commitLoadTime",
26990
27858
  "commitPreferences",
26991
27859
  "commitStyles",
27860
+ "committed",
26992
27861
  "commonAncestorContainer",
26993
27862
  "compact",
26994
27863
  "compare",
@@ -27024,6 +27893,7 @@ var domprops = [
27024
27893
  "coneOuterAngle",
27025
27894
  "coneOuterGain",
27026
27895
  "config",
27896
+ "configURL",
27027
27897
  "configurable",
27028
27898
  "configuration",
27029
27899
  "configurationName",
@@ -27042,6 +27912,7 @@ var domprops = [
27042
27912
  "connectStart",
27043
27913
  "connected",
27044
27914
  "connectedCallback",
27915
+ "connectedMoveCallback",
27045
27916
  "connection",
27046
27917
  "connectionInfo",
27047
27918
  "connectionList",
@@ -27082,6 +27953,7 @@ var domprops = [
27082
27953
  "contentBoxSize",
27083
27954
  "contentDocument",
27084
27955
  "contentEditable",
27956
+ "contentEncoding",
27085
27957
  "contentHint",
27086
27958
  "contentOverflow",
27087
27959
  "contentRect",
@@ -27348,7 +28220,11 @@ var domprops = [
27348
28220
  "databases",
27349
28221
  "datagrams",
27350
28222
  "dataset",
28223
+ "dateStyle",
27351
28224
  "dateTime",
28225
+ "day",
28226
+ "dayPeriod",
28227
+ "days",
27352
28228
  "db",
27353
28229
  "debug",
27354
28230
  "debuggerEnabled",
@@ -27362,6 +28238,7 @@ var domprops = [
27362
28238
  "decodedBodySize",
27363
28239
  "decoding",
27364
28240
  "decodingInfo",
28241
+ "decreaseZoomLevel",
27365
28242
  "decrypt",
27366
28243
  "default",
27367
28244
  "defaultCharset",
@@ -27432,6 +28309,7 @@ var domprops = [
27432
28309
  "deprecatedReplaceInURN",
27433
28310
  "deprecatedRunAdAuctionEnforcesKAnonymity",
27434
28311
  "deprecatedURNToURL",
28312
+ "depthActive",
27435
28313
  "depthBias",
27436
28314
  "depthBiasClamp",
27437
28315
  "depthBiasSlopeScale",
@@ -27451,6 +28329,7 @@ var domprops = [
27451
28329
  "depthStencilAttachment",
27452
28330
  "depthStencilFormat",
27453
28331
  "depthStoreOp",
28332
+ "depthType",
27454
28333
  "depthUsage",
27455
28334
  "depthWriteEnabled",
27456
28335
  "deref",
@@ -27479,6 +28358,7 @@ var domprops = [
27479
28358
  "deviceMemory",
27480
28359
  "devicePixelContentBoxSize",
27481
28360
  "devicePixelRatio",
28361
+ "devicePosture",
27482
28362
  "deviceProtocol",
27483
28363
  "deviceSubclass",
27484
28364
  "deviceVersionMajor",
@@ -27518,6 +28398,8 @@ var domprops = [
27518
28398
  "displayName",
27519
28399
  "displayWidth",
27520
28400
  "dispose",
28401
+ "disposeAsync",
28402
+ "disposed",
27521
28403
  "disposition",
27522
28404
  "distanceModel",
27523
28405
  "div",
@@ -27539,6 +28421,7 @@ var domprops = [
27539
28421
  "documentOrigins",
27540
28422
  "documentPictureInPicture",
27541
28423
  "documentURI",
28424
+ "documentURL",
27542
28425
  "documentUrl",
27543
28426
  "documentUrls",
27544
28427
  "dolphin",
@@ -27694,6 +28577,7 @@ var domprops = [
27694
28577
  "enumerateEditable",
27695
28578
  "environmentBlendMode",
27696
28579
  "equals",
28580
+ "era",
27697
28581
  "error",
27698
28582
  "errorCode",
27699
28583
  "errorDetail",
@@ -27725,7 +28609,9 @@ var domprops = [
27725
28609
  "expandEntityReferences",
27726
28610
  "expando",
27727
28611
  "expansion",
28612
+ "expectedContextLanguages",
27728
28613
  "expectedImprovement",
28614
+ "expectedInputLanguages",
27729
28615
  "experiments",
27730
28616
  "expiration",
27731
28617
  "expirationTime",
@@ -27768,6 +28654,7 @@ var domprops = [
27768
28654
  "fence",
27769
28655
  "fenceSync",
27770
28656
  "fetch",
28657
+ "fetchLater",
27771
28658
  "fetchPriority",
27772
28659
  "fetchStart",
27773
28660
  "fftSize",
@@ -27799,6 +28686,7 @@ var domprops = [
27799
28686
  "filterResY",
27800
28687
  "filterUnits",
27801
28688
  "filters",
28689
+ "finalResponseHeadersStart",
27802
28690
  "finally",
27803
28691
  "find",
27804
28692
  "findIndex",
@@ -27812,6 +28700,7 @@ var domprops = [
27812
28700
  "finished",
27813
28701
  "fireEvent",
27814
28702
  "firesTouchEvents",
28703
+ "first",
27815
28704
  "firstChild",
27816
28705
  "firstElementChild",
27817
28706
  "firstInterimResponseStart",
@@ -27836,6 +28725,7 @@ var domprops = [
27836
28725
  "flexGrow",
27837
28726
  "flexShrink",
27838
28727
  "flexWrap",
28728
+ "flip",
27839
28729
  "flipX",
27840
28730
  "flipY",
27841
28731
  "float",
@@ -27897,6 +28787,7 @@ var domprops = [
27897
28787
  "fontVariantAlternates",
27898
28788
  "fontVariantCaps",
27899
28789
  "fontVariantEastAsian",
28790
+ "fontVariantEmoji",
27900
28791
  "fontVariantLigatures",
27901
28792
  "fontVariantNumeric",
27902
28793
  "fontVariantPosition",
@@ -27926,11 +28817,13 @@ var domprops = [
27926
28817
  "formatToParts",
27927
28818
  "forms",
27928
28819
  "forward",
28820
+ "forwardWheel",
27929
28821
  "forwardX",
27930
28822
  "forwardY",
27931
28823
  "forwardZ",
27932
28824
  "foundation",
27933
28825
  "fr",
28826
+ "fractionalSecondDigits",
27934
28827
  "fragment",
27935
28828
  "fragmentDirective",
27936
28829
  "frame",
@@ -28002,6 +28895,7 @@ var domprops = [
28002
28895
  "getAdjacentText",
28003
28896
  "getAll",
28004
28897
  "getAllKeys",
28898
+ "getAllRecords",
28005
28899
  "getAllResponseHeaders",
28006
28900
  "getAllowlistForFeature",
28007
28901
  "getAnimations",
@@ -28050,11 +28944,13 @@ var domprops = [
28050
28944
  "getCharNumAtPosition",
28051
28945
  "getCharacteristic",
28052
28946
  "getCharacteristics",
28947
+ "getClientCapabilities",
28053
28948
  "getClientExtensionResults",
28054
28949
  "getClientRect",
28055
28950
  "getClientRects",
28056
28951
  "getCoalescedEvents",
28057
28952
  "getCompilationInfo",
28953
+ "getComposedRanges",
28058
28954
  "getCompositionAlternatives",
28059
28955
  "getComputedStyle",
28060
28956
  "getComputedTextLength",
@@ -28178,6 +29074,8 @@ var domprops = [
28178
29074
  "getNotifier",
28179
29075
  "getNumberOfChars",
28180
29076
  "getOffsetReferenceSpace",
29077
+ "getOrInsert",
29078
+ "getOrInsertComputed",
28181
29079
  "getOutputTimestamp",
28182
29080
  "getOverrideHistoryNavigationMode",
28183
29081
  "getOverrideStyle",
@@ -28189,7 +29087,9 @@ var domprops = [
28189
29087
  "getParameter",
28190
29088
  "getParameters",
28191
29089
  "getParent",
29090
+ "getPathData",
28192
29091
  "getPathSegAtLength",
29092
+ "getPathSegmentAtLength",
28193
29093
  "getPermissionWarningsByManifest",
28194
29094
  "getPhotoCapabilities",
28195
29095
  "getPhotoSettings",
@@ -28271,6 +29171,7 @@ var domprops = [
28271
29171
  "getSupportedConstraints",
28272
29172
  "getSupportedExtensions",
28273
29173
  "getSupportedFormats",
29174
+ "getSupportedZoomLevels",
28274
29175
  "getSyncParameter",
28275
29176
  "getSynchronizationSources",
28276
29177
  "getTags",
@@ -28443,6 +29344,7 @@ var domprops = [
28443
29344
  "highWaterMark",
28444
29345
  "highlight",
28445
29346
  "highlights",
29347
+ "highlightsFromPoint",
28446
29348
  "hint",
28447
29349
  "hints",
28448
29350
  "history",
@@ -28452,6 +29354,10 @@ var domprops = [
28452
29354
  "host",
28453
29355
  "hostCandidate",
28454
29356
  "hostname",
29357
+ "hour",
29358
+ "hour12",
29359
+ "hourCycle",
29360
+ "hours",
28455
29361
  "href",
28456
29362
  "hrefTranslate",
28457
29363
  "hreflang",
@@ -28464,6 +29370,7 @@ var domprops = [
28464
29370
  "hwTimestamp",
28465
29371
  "hyphenate-character",
28466
29372
  "hyphenateCharacter",
29373
+ "hyphenateLimitChars",
28467
29374
  "hyphens",
28468
29375
  "hypot",
28469
29376
  "i18n",
@@ -28517,6 +29424,7 @@ var domprops = [
28517
29424
  "incomingHighWaterMark",
28518
29425
  "incomingMaxAge",
28519
29426
  "incomingUnidirectionalStreams",
29427
+ "increaseZoomLevel",
28520
29428
  "incremental",
28521
29429
  "indeterminate",
28522
29430
  "index",
@@ -28594,6 +29502,7 @@ var domprops = [
28594
29502
  "inputEncoding",
28595
29503
  "inputMethod",
28596
29504
  "inputMode",
29505
+ "inputQuota",
28597
29506
  "inputSource",
28598
29507
  "inputSources",
28599
29508
  "inputType",
@@ -28623,6 +29532,7 @@ var domprops = [
28623
29532
  "insetInline",
28624
29533
  "insetInlineEnd",
28625
29534
  "insetInlineStart",
29535
+ "inspect",
28626
29536
  "install",
28627
29537
  "installing",
28628
29538
  "instanceRoot",
@@ -28633,9 +29543,11 @@ var domprops = [
28633
29543
  "int32",
28634
29544
  "int8",
28635
29545
  "integrity",
29546
+ "interactionCount",
28636
29547
  "interactionId",
28637
29548
  "interactionMode",
28638
29549
  "intercept",
29550
+ "interestForElement",
28639
29551
  "interfaceClass",
28640
29552
  "interfaceName",
28641
29553
  "interfaceNumber",
@@ -28685,6 +29597,7 @@ var domprops = [
28685
29597
  "isEnabled",
28686
29598
  "isEqual",
28687
29599
  "isEqualNode",
29600
+ "isError",
28688
29601
  "isExtended",
28689
29602
  "isExtensible",
28690
29603
  "isExternalCTAP2SecurityKeySupported",
@@ -28808,6 +29721,7 @@ var domprops = [
28808
29721
  "language",
28809
29722
  "languages",
28810
29723
  "largeArcFlag",
29724
+ "last",
28811
29725
  "lastChild",
28812
29726
  "lastElementChild",
28813
29727
  "lastError",
@@ -29040,6 +29954,7 @@ var domprops = [
29040
29954
  "math-depth",
29041
29955
  "math-style",
29042
29956
  "mathDepth",
29957
+ "mathShift",
29043
29958
  "mathStyle",
29044
29959
  "matrix",
29045
29960
  "matrixTransform",
@@ -29102,6 +30017,7 @@ var domprops = [
29102
30017
  "maxWidth",
29103
30018
  "maximumLatency",
29104
30019
  "measure",
30020
+ "measureInputUsage",
29105
30021
  "measureText",
29106
30022
  "media",
29107
30023
  "mediaCapabilities",
@@ -29129,7 +30045,9 @@ var domprops = [
29129
30045
  "method",
29130
30046
  "methodDetails",
29131
30047
  "methodName",
30048
+ "microseconds",
29132
30049
  "mid",
30050
+ "milliseconds",
29133
30051
  "mimeType",
29134
30052
  "mimeTypes",
29135
30053
  "min",
@@ -29149,6 +30067,8 @@ var domprops = [
29149
30067
  "minValue",
29150
30068
  "minWidth",
29151
30069
  "minimumLatency",
30070
+ "minute",
30071
+ "minutes",
29152
30072
  "mipLevel",
29153
30073
  "mipLevelCount",
29154
30074
  "mipmapFilter",
@@ -29161,8 +30081,11 @@ var domprops = [
29161
30081
  "model",
29162
30082
  "modify",
29163
30083
  "module",
30084
+ "month",
30085
+ "months",
29164
30086
  "mount",
29165
30087
  "move",
30088
+ "moveBefore",
29166
30089
  "moveBy",
29167
30090
  "moveEnd",
29168
30091
  "moveFirst",
@@ -29426,6 +30349,7 @@ var domprops = [
29426
30349
  "names",
29427
30350
  "namespaceURI",
29428
30351
  "namespaces",
30352
+ "nanoseconds",
29429
30353
  "nativeApplication",
29430
30354
  "nativeMap",
29431
30355
  "nativeObjectCreate",
@@ -29496,6 +30420,8 @@ var domprops = [
29496
30420
  "numberOfItems",
29497
30421
  "numberOfOutputs",
29498
30422
  "numberValue",
30423
+ "numberingSystem",
30424
+ "numeric",
29499
30425
  "oMatchesSelector",
29500
30426
  "object",
29501
30427
  "object-fit",
@@ -29506,6 +30432,7 @@ var domprops = [
29506
30432
  "objectStoreNames",
29507
30433
  "objectType",
29508
30434
  "observe",
30435
+ "observedAttributes",
29509
30436
  "occlusionQuerySet",
29510
30437
  "of",
29511
30438
  "off",
@@ -29636,6 +30563,7 @@ var domprops = [
29636
30563
  "onclick",
29637
30564
  "onclose",
29638
30565
  "onclosing",
30566
+ "oncommand",
29639
30567
  "oncompassneedscalibration",
29640
30568
  "oncomplete",
29641
30569
  "oncompositionend",
@@ -29673,6 +30601,7 @@ var domprops = [
29673
30601
  "ondisplay",
29674
30602
  "ondispose",
29675
30603
  "ondownloading",
30604
+ "ondownloadprogress",
29676
30605
  "ondrag",
29677
30606
  "ondragend",
29678
30607
  "ondragenter",
@@ -29949,6 +30878,7 @@ var domprops = [
29949
30878
  "onwebkittransitionend",
29950
30879
  "onwheel",
29951
30880
  "onzoom",
30881
+ "onzoomlevelchange",
29952
30882
  "opacity",
29953
30883
  "open",
29954
30884
  "openCursor",
@@ -29984,6 +30914,7 @@ var domprops = [
29984
30914
  "originAgentCluster",
29985
30915
  "originalPolicy",
29986
30916
  "originalTarget",
30917
+ "ornaments",
29987
30918
  "orphans",
29988
30919
  "os",
29989
30920
  "oscpu",
@@ -30004,8 +30935,10 @@ var domprops = [
30004
30935
  "outlineWidth",
30005
30936
  "outputBuffer",
30006
30937
  "outputChannelCount",
30938
+ "outputLanguage",
30007
30939
  "outputLatency",
30008
30940
  "outputs",
30941
+ "overallProgress",
30009
30942
  "overflow",
30010
30943
  "overflow-anchor",
30011
30944
  "overflow-block",
@@ -30094,6 +31027,7 @@ var domprops = [
30094
31027
  "paint-order",
30095
31028
  "paintOrder",
30096
31029
  "paintRequests",
31030
+ "paintTime",
30097
31031
  "paintType",
30098
31032
  "paintWorklet",
30099
31033
  "palette",
@@ -30135,6 +31069,7 @@ var domprops = [
30135
31069
  "patternUnits",
30136
31070
  "pause",
30137
31071
  "pauseAnimations",
31072
+ "pauseDepthSensing",
30138
31073
  "pauseDuration",
30139
31074
  "pauseOnExit",
30140
31075
  "pauseProfilers",
@@ -30167,6 +31102,8 @@ var domprops = [
30167
31102
  "phoneticFamilyName",
30168
31103
  "phoneticGivenName",
30169
31104
  "photo",
31105
+ "phrase",
31106
+ "phrases",
30170
31107
  "pictureInPictureChild",
30171
31108
  "pictureInPictureElement",
30172
31109
  "pictureInPictureEnabled",
@@ -30177,6 +31114,7 @@ var domprops = [
30177
31114
  "pitch",
30178
31115
  "pixelBottom",
30179
31116
  "pixelDepth",
31117
+ "pixelFormat",
30180
31118
  "pixelHeight",
30181
31119
  "pixelLeft",
30182
31120
  "pixelRight",
@@ -30247,6 +31185,9 @@ var domprops = [
30247
31185
  "positionAlign",
30248
31186
  "positionAnchor",
30249
31187
  "positionArea",
31188
+ "positionTry",
31189
+ "positionTryFallbacks",
31190
+ "positionVisibility",
30250
31191
  "positionX",
30251
31192
  "positionY",
30252
31193
  "positionZ",
@@ -30273,6 +31214,7 @@ var domprops = [
30273
31214
  "presentation",
30274
31215
  "presentationArea",
30275
31216
  "presentationStyle",
31217
+ "presentationTime",
30276
31218
  "preserveAlpha",
30277
31219
  "preserveAspectRatio",
30278
31220
  "preserveAspectRatioString",
@@ -30311,6 +31253,7 @@ var domprops = [
30311
31253
  "probeSpace",
30312
31254
  "process",
30313
31255
  "processIceMessage",
31256
+ "processLocally",
30314
31257
  "processingEnd",
30315
31258
  "processingStart",
30316
31259
  "processorOptions",
@@ -30323,6 +31266,7 @@ var domprops = [
30323
31266
  "profiles",
30324
31267
  "projectionMatrix",
30325
31268
  "promise",
31269
+ "promising",
30326
31270
  "prompt",
30327
31271
  "properties",
30328
31272
  "propertyIsEnumerable",
@@ -30367,6 +31311,7 @@ var domprops = [
30367
31311
  "querySet",
30368
31312
  "queue",
30369
31313
  "queueMicrotask",
31314
+ "quota",
30370
31315
  "quote",
30371
31316
  "quotes",
30372
31317
  "r",
@@ -30545,6 +31490,7 @@ var domprops = [
30545
31490
  "reportError",
30546
31491
  "reportEvent",
30547
31492
  "reportId",
31493
+ "reportOnly",
30548
31494
  "reportValidity",
30549
31495
  "request",
30550
31496
  "requestAdapter",
@@ -30580,6 +31526,7 @@ var domprops = [
30580
31526
  "requestVideoFrameCallback",
30581
31527
  "requestViewportScale",
30582
31528
  "requestWindow",
31529
+ "requested",
30583
31530
  "requestingWindow",
30584
31531
  "requireInteraction",
30585
31532
  "required",
@@ -30590,6 +31537,7 @@ var domprops = [
30590
31537
  "resetLatency",
30591
31538
  "resetPose",
30592
31539
  "resetTransform",
31540
+ "resetZoomLevel",
30593
31541
  "resizable",
30594
31542
  "resize",
30595
31543
  "resizeBy",
@@ -30614,14 +31562,17 @@ var domprops = [
30614
31562
  "restartAfterDelay",
30615
31563
  "restartIce",
30616
31564
  "restore",
31565
+ "restrictTo",
30617
31566
  "result",
30618
31567
  "resultIndex",
30619
31568
  "resultType",
30620
31569
  "results",
30621
31570
  "resume",
31571
+ "resumeDepthSensing",
30622
31572
  "resumeProfilers",
30623
31573
  "resumeTransformFeedback",
30624
31574
  "retry",
31575
+ "returnType",
30625
31576
  "returnValue",
30626
31577
  "rev",
30627
31578
  "reverse",
@@ -30818,14 +31769,18 @@ var domprops = [
30818
31769
  "searchBox",
30819
31770
  "searchBoxJavaBridge_",
30820
31771
  "searchParams",
31772
+ "second",
31773
+ "seconds",
30821
31774
  "sectionRowIndex",
30822
31775
  "secureConnectionStart",
31776
+ "securePaymentConfirmationAvailability",
30823
31777
  "security",
30824
31778
  "seed",
30825
31779
  "seek",
30826
31780
  "seekToNextFrame",
30827
31781
  "seekable",
30828
31782
  "seeking",
31783
+ "segments",
30829
31784
  "select",
30830
31785
  "selectAllChildren",
30831
31786
  "selectAlternateInterface",
@@ -30960,6 +31915,7 @@ var domprops = [
30960
31915
  "setPaint",
30961
31916
  "setParameter",
30962
31917
  "setParameters",
31918
+ "setPathData",
30963
31919
  "setPeriodicWave",
30964
31920
  "setPipeline",
30965
31921
  "setPointerCapture",
@@ -31058,6 +32014,7 @@ var domprops = [
31058
32014
  "shapeOutside",
31059
32015
  "shapeRendering",
31060
32016
  "share",
32017
+ "sharedContext",
31061
32018
  "sharedStorage",
31062
32019
  "sharedStorageWritable",
31063
32020
  "sheet",
@@ -31082,6 +32039,9 @@ var domprops = [
31082
32039
  "sidebarAction",
31083
32040
  "sign",
31084
32041
  "signal",
32042
+ "signalAllAcceptedCredentials",
32043
+ "signalCurrentUserDetails",
32044
+ "signalUnknownCredential",
31085
32045
  "signalingState",
31086
32046
  "signature",
31087
32047
  "silent",
@@ -31123,9 +32083,11 @@ var domprops = [
31123
32083
  "sourceBuffers",
31124
32084
  "sourceCapabilities",
31125
32085
  "sourceCharPosition",
32086
+ "sourceElement",
31126
32087
  "sourceFile",
31127
32088
  "sourceFunctionName",
31128
32089
  "sourceIndex",
32090
+ "sourceLanguage",
31129
32091
  "sourceMap",
31130
32092
  "sourceURL",
31131
32093
  "sources",
@@ -31266,8 +32228,12 @@ var domprops = [
31266
32228
  "styleSheet",
31267
32229
  "styleSheetSets",
31268
32230
  "styleSheets",
32231
+ "styleset",
32232
+ "stylistic",
31269
32233
  "sub",
31270
32234
  "subarray",
32235
+ "subgroupMaxSize",
32236
+ "subgroupMinSize",
31271
32237
  "subject",
31272
32238
  "submit",
31273
32239
  "submitFrame",
@@ -31280,6 +32246,9 @@ var domprops = [
31280
32246
  "subtree",
31281
32247
  "suffix",
31282
32248
  "suffixes",
32249
+ "sumPrecise",
32250
+ "summarize",
32251
+ "summarizeStreaming",
31283
32252
  "summary",
31284
32253
  "sup",
31285
32254
  "supported",
@@ -31290,6 +32259,7 @@ var domprops = [
31290
32259
  "supportsFiber",
31291
32260
  "supportsSession",
31292
32261
  "supportsText",
32262
+ "suppressed",
31293
32263
  "surfaceScale",
31294
32264
  "surroundContents",
31295
32265
  "suspend",
@@ -31302,7 +32272,9 @@ var domprops = [
31302
32272
  "svw",
31303
32273
  "swapCache",
31304
32274
  "swapNode",
32275
+ "swash",
31305
32276
  "sweepFlag",
32277
+ "switchMap",
31306
32278
  "symbols",
31307
32279
  "symmetricDifference",
31308
32280
  "sync",
@@ -31336,12 +32308,14 @@ var domprops = [
31336
32308
  "take",
31337
32309
  "takePhoto",
31338
32310
  "takeRecords",
32311
+ "takeUntil",
31339
32312
  "tan",
31340
32313
  "tangentialPressure",
31341
32314
  "tanh",
31342
32315
  "target",
31343
32316
  "targetAddressSpace",
31344
32317
  "targetElement",
32318
+ "targetLanguage",
31345
32319
  "targetRayMode",
31346
32320
  "targetRaySpace",
31347
32321
  "targetTouches",
@@ -31400,6 +32374,7 @@ var domprops = [
31400
32374
  "textDecoration",
31401
32375
  "textDecorationBlink",
31402
32376
  "textDecorationColor",
32377
+ "textDecorationInset",
31403
32378
  "textDecorationLine",
31404
32379
  "textDecorationLineThrough",
31405
32380
  "textDecorationNone",
@@ -31444,6 +32419,9 @@ var domprops = [
31444
32419
  "timeOrigin",
31445
32420
  "timeRemaining",
31446
32421
  "timeStamp",
32422
+ "timeStyle",
32423
+ "timeZone",
32424
+ "timeZoneName",
31447
32425
  "timecode",
31448
32426
  "timeline",
31449
32427
  "timelineTime",
@@ -31490,6 +32468,7 @@ var domprops = [
31490
32468
  "toString",
31491
32469
  "toStringTag",
31492
32470
  "toSum",
32471
+ "toTemporalInstant",
31493
32472
  "toTimeString",
31494
32473
  "toUTCString",
31495
32474
  "toUpperCase",
@@ -31561,6 +32540,7 @@ var domprops = [
31561
32540
  "transitionTimingFunction",
31562
32541
  "translate",
31563
32542
  "translateSelf",
32543
+ "translateStreaming",
31564
32544
  "translationX",
31565
32545
  "translationY",
31566
32546
  "transport",
@@ -31709,6 +32689,7 @@ var domprops = [
31709
32689
  "usbVersionMajor",
31710
32690
  "usbVersionMinor",
31711
32691
  "usbVersionSubminor",
32692
+ "use",
31712
32693
  "useCurrentView",
31713
32694
  "useMap",
31714
32695
  "useProgram",
@@ -31716,6 +32697,7 @@ var domprops = [
31716
32697
  "user-select",
31717
32698
  "userActivation",
31718
32699
  "userAgent",
32700
+ "userAgentAllowsProtocol",
31719
32701
  "userAgentData",
31720
32702
  "userChoice",
31721
32703
  "userHandle",
@@ -31799,6 +32781,8 @@ var domprops = [
31799
32781
  "viewTarget",
31800
32782
  "viewTargetString",
31801
32783
  "viewTransition",
32784
+ "viewTransitionClass",
32785
+ "viewTransitionName",
31802
32786
  "viewport",
31803
32787
  "viewportAnchorX",
31804
32788
  "viewportAnchorY",
@@ -32027,12 +33011,15 @@ var domprops = [
32027
33011
  "webkitdirectory",
32028
33012
  "webkitdropzone",
32029
33013
  "webstore",
33014
+ "weekday",
33015
+ "weeks",
32030
33016
  "weight",
32031
33017
  "wgslLanguageFeatures",
32032
33018
  "whatToShow",
32033
33019
  "wheelDelta",
32034
33020
  "wheelDeltaX",
32035
33021
  "wheelDeltaY",
33022
+ "when",
32036
33023
  "whenDefined",
32037
33024
  "which",
32038
33025
  "white-space",
@@ -32060,6 +33047,10 @@ var domprops = [
32060
33047
  "wordBreak",
32061
33048
  "wordSpacing",
32062
33049
  "wordWrap",
33050
+ "workerCacheLookupStart",
33051
+ "workerFinalSourceType",
33052
+ "workerMatchedSourceType",
33053
+ "workerRouterEvaluationStart",
32063
33054
  "workerStart",
32064
33055
  "worklet",
32065
33056
  "wow64",
@@ -32098,12 +33089,15 @@ var domprops = [
32098
33089
  "y2",
32099
33090
  "yChannelSelector",
32100
33091
  "yandex",
33092
+ "year",
33093
+ "years",
32101
33094
  "yield",
32102
33095
  "z",
32103
33096
  "z-index",
32104
33097
  "zIndex",
32105
33098
  "zoom",
32106
33099
  "zoomAndPan",
33100
+ "zoomLevel",
32107
33101
  "zoomRectScreen",
32108
33102
  ];
32109
33103