terser 5.2.0 → 5.2.1

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.
package/lib/parse.js CHANGED
@@ -467,7 +467,7 @@ function tokenizer($TEXT, filename, html5_comments, shebang) {
467
467
  (type == "keyword" && KEYWORDS_BEFORE_EXPRESSION.has(value)) ||
468
468
  (type == "punc" && PUNC_BEFORE_EXPRESSION.has(value))) ||
469
469
  (type == "arrow");
470
- if (type == "punc" && value == ".") {
470
+ if (type == "punc" && (value == "." || value == "?.")) {
471
471
  prev_was_dot = true;
472
472
  } else if (!is_comment) {
473
473
  prev_was_dot = false;
@@ -1029,7 +1029,7 @@ function parse($TEXT, options) {
1029
1029
 
1030
1030
  options = defaults(options, {
1031
1031
  bare_returns : false,
1032
- ecma : 2017,
1032
+ ecma : null, // Legacy
1033
1033
  expression : false,
1034
1034
  filename : null,
1035
1035
  html5_comments : true,
@@ -1609,7 +1609,6 @@ function parse($TEXT, options) {
1609
1609
 
1610
1610
  if (!is("punc", ")")) {
1611
1611
  expect(",");
1612
- if (is("punc", ")") && options.ecma < 2017) unexpected();
1613
1612
  }
1614
1613
 
1615
1614
  if (param instanceof AST_Expansion) {
@@ -1854,7 +1853,6 @@ function parse($TEXT, options) {
1854
1853
  if (!is("punc", ")")) {
1855
1854
  expect(",");
1856
1855
  if (is("punc", ")")) {
1857
- if (options.ecma < 2017) unexpected();
1858
1856
  trailing_comma = prev();
1859
1857
  if (maybe_sequence) invalid_sequence = trailing_comma;
1860
1858
  }
@@ -2123,7 +2121,7 @@ function parse($TEXT, options) {
2123
2121
  var newexp = expr_atom(false), args;
2124
2122
  if (is("punc", "(")) {
2125
2123
  next();
2126
- args = expr_list(")", options.ecma >= 2017);
2124
+ args = expr_list(")", true);
2127
2125
  } else {
2128
2126
  args = [];
2129
2127
  }
@@ -3042,7 +3040,6 @@ function parse($TEXT, options) {
3042
3040
  }
3043
3041
  if (!is("punc", ")")) {
3044
3042
  expect(",");
3045
- if (is("punc", ")") && options.ecma < 2017) unexpected();
3046
3043
  }
3047
3044
  }
3048
3045
  next();
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "homepage": "https://terser.org",
5
5
  "author": "Mihai Bazon <mihai.bazon@gmail.com> (http://lisperator.net/)",
6
6
  "license": "BSD-2-Clause",
7
- "version": "5.2.0",
7
+ "version": "5.2.1",
8
8
  "engines": {
9
9
  "node": ">=6.0.0"
10
10
  },