diff --git a/src/js_lexer_tables.zig b/src/js_lexer_tables.zig index 8256ff79d23ca2..60a705c3012844 100644 --- a/src/js_lexer_tables.zig +++ b/src/js_lexer_tables.zig @@ -250,11 +250,12 @@ pub const PropertyModifierKeyword = enum { }); }; -pub const TypeScriptAccessibilityModifier = ComptimeStringMap(u1, .{ - .{ "private", 1 }, - .{ "protected", 1 }, - .{ "public", 1 }, - .{ "readonly", 1 }, +pub const TypeScriptAccessibilityModifier = ComptimeStringMap(void, .{ + .{ "override", void }, + .{ "private", void }, + .{ "protected", void }, + .{ "public", void }, + .{ "readonly", void }, }); pub const TokenEnumType = std.EnumArray(T, []u8); diff --git a/test/transpiler/7324.test.ts b/test/transpiler/7324.test.ts new file mode 100644 index 00000000000000..24d402d2f5daa1 --- /dev/null +++ b/test/transpiler/7324.test.ts @@ -0,0 +1,21 @@ +import { test, expect } from "bun:test"; + +test("override is an accessibility modifier", () => { + class FooParent {} + + class FooChild extends FooParent {} + + class BarParent { + constructor(readonly foo: FooParent) {} + } + + class BarChild extends BarParent { + constructor(override foo: FooChild) { + super(foo); + } + } + + new BarChild(new FooChild()); + + expect().pass(); +});