Skip to content

Commit

Permalink
allow 'get;' as a class property without value. Closes #1078
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiosantoscode committed Oct 2, 2021
1 parent fc1e6e7 commit 01f1841
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/parse.js
Expand Up @@ -2551,7 +2551,7 @@ function parse($TEXT, options) {
};

const is_not_method_start = () =>
!is("punc", "(") && !is("punc", ",") && !is("punc", "}") && !is("operator", "=");
!is("punc", "(") && !is("punc", ",") && !is("punc", "}") && !is("punc", ";") && !is("operator", "=");

var is_async = false;
var is_static = false;
Expand Down
6 changes: 4 additions & 2 deletions test/compress/class-properties.js
Expand Up @@ -9,11 +9,13 @@ basic_class_properties: {
= "P"
another =
"A";
get;
set = "S";
#private;
#private2 = "SS";
#private2 = "S";
toString() {
if ('bar' in this && 'foo' in A) {
return A.fil + this.another + this.#private2
return A.fil + this.another + this.set + this.#private2
}
}
}
Expand Down

0 comments on commit 01f1841

Please sign in to comment.