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/CHANGELOG.md +5 -0
- package/README.md +1 -5
- package/dist/bundle.min.js +3 -6
- package/dist/bundle.min.js.map +1 -1
- package/lib/parse.js +3 -6
- package/package.json +1 -1
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 :
|
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(")",
|
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();
|