Skip to content

Commit

Permalink
feat: use webidl 'value.name' for emscripten setter parameter name
Browse files Browse the repository at this point in the history
  • Loading branch information
isaac-mason committed Oct 7, 2023
1 parent 24cc9e9 commit f52d614
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/khaki-mails-cheer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"webidl-dts-gen": minor
---

feat: use webidl `value.name` for emscripten setter parameter name
4 changes: 2 additions & 2 deletions packages/webidl-dts-gen/src/convert-idl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ function createEmscriptenAttributeSetter(value: webidl2.AttributeMemberType) {
ts.factory.createParameterDeclaration(
[],
undefined,
'value',
value.name,
undefined,
convertType(idlType),
),
Expand All @@ -397,7 +397,7 @@ function createEmscriptenAttributeSetter(value: webidl2.AttributeMemberType) {
ts.factory.createParameterDeclaration(
[],
undefined,
'value',
value.name,
undefined,
convertType(idlType),
),
Expand Down
4 changes: 2 additions & 2 deletions packages/webidl-dts-gen/tst/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ describe('convert', () => {
withDefaultEmscriptenOutput(
'class Foo {', //
' get_position(): number;', //
' set_position(value: number): void;', //
' set_position(position: number): void;', //
' position: number;', //
'}', //
),
Expand All @@ -228,7 +228,7 @@ describe('convert', () => {
withDefaultEmscriptenOutput(
'class Foo {', //
' get_position(index: number): number;', //
' set_position(index: number, value: number): void;', //
' set_position(index: number, position: number): void;', //
' position: number;', //
'}', //
),
Expand Down

0 comments on commit f52d614

Please sign in to comment.