Skip to content

Commit 929f8b9

Browse files
committed
fix versions handling
1 parent d9cb05e commit 929f8b9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/parser/class.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ module.exports = {
235235
}
236236

237237
const [nullable, type] =
238-
this.version >= 830 ? this.read_optional_type() : [false, null];
238+
this.version >= 803 ? this.read_optional_type() : [false, null];
239239

240240
const result = this.node("classconstant");
241241
const items = this.read_list(

test/snapshot/classconstant.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ describe("classconstant", () => {
4343
expect(
4444
parser.parseEval(
4545
'class Foo { public const string CONSTANT = "Hello world!"; }',
46-
{ parser: { version: 830 } },
46+
{ parser: { version: 803 } },
4747
),
4848
).toMatchSnapshot();
4949
});
5050
it("type hinted (unsupported)", () => {
5151
expect(() =>
5252
parser.parseEval(
5353
'class Foo { public const string CONSTANT = "Hello world!"; }',
54-
{ parser: { version: 820 } },
54+
{ parser: { version: 802 } },
5555
),
5656
).toThrowErrorMatchingSnapshot();
5757
});

0 commit comments

Comments
 (0)