Skip to content

Commit

Permalink
fix: incorrect version numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
czosel committed Dec 4, 2024
1 parent d9cb05e commit 2336054
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/parser/class.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ module.exports = {
}

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

const result = this.node("classconstant");
const items = this.read_list(
Expand Down
4 changes: 2 additions & 2 deletions test/snapshot/classconstant.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ describe("classconstant", () => {
expect(
parser.parseEval(
'class Foo { public const string CONSTANT = "Hello world!"; }',
{ parser: { version: 830 } },
{ parser: { version: 803 } },
),
).toMatchSnapshot();
});
it("type hinted (unsupported)", () => {
expect(() =>
parser.parseEval(
'class Foo { public const string CONSTANT = "Hello world!"; }',
{ parser: { version: 820 } },
{ parser: { version: 802 } },
),
).toThrowErrorMatchingSnapshot();
});
Expand Down

0 comments on commit 2336054

Please sign in to comment.