Skip to content

Commit

Permalink
fix: fix missing static for computed class property
Browse files Browse the repository at this point in the history
closes #106
  • Loading branch information
3cp committed Oct 16, 2020
1 parent d2fc187 commit bd00159
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8317,7 +8317,7 @@ function parseClassElementList(
default: // ignore
}
} else if (token === Token.LeftBracket) {
kind = PropertyKind.Computed;
kind |= PropertyKind.Computed;
key = parseComputedPropertyName(parser, inheritedContext, inGroup);
} else if ((token & Token.IsStringOrNumber) === Token.IsStringOrNumber) {
key = parseLiteral(parser, context);
Expand Down
4 changes: 2 additions & 2 deletions test/parser/expressions/class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@ describe('Expressions - Class', () => {
2() { return 2; }
1.1() { return 1.1; }
2.2() { return 2.2; }
[1+3]() { return 4; }
static [1+3]() { return 4; }
[1.1+1]() { return 2.1; }
["foo"+1]() { return "foo1"; }
[sym1](){return "bart";}
Expand Down Expand Up @@ -1413,7 +1413,7 @@ describe('Expressions - Class', () => {
{
type: 'MethodDefinition',
kind: 'method',
static: false,
static: true,
computed: true,
key: {
type: 'BinaryExpression',
Expand Down

0 comments on commit bd00159

Please sign in to comment.