Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions inputfiles/addedTypes.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@
"optional"
]
},
"ClientType": {
"name": "ClientTypes"
},
"RTCStatsIceCandidatePairState": {
"value": [
"inprogress"
Expand Down
1 change: 1 addition & 0 deletions inputfiles/patches/type-rename.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enum ClientType name="ClientTypes"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW you can also skip quote.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you like me to remove them? I find it more readable with quotes, especially for properties

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enum ClientType name="ClientTypes"
enum ClientType name=ClientTypes

The quote gives a strong signal of "I'm string", but technically everything is string here, including enum (you can do "enum" and get the same result). So I prefer skipping it for consistency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

2 changes: 1 addition & 1 deletion src/build/patches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function parseKDL(kdlText: string): DeepPartial<WebIdl> {
* @param enums The record of enums to update.
*/
function handleEnum(node: Node): Enum {
const name = node.values[0];
const name = node.properties?.name || node.values[0];
if (typeof name !== "string") {
throw new Error("Missing enum name");
}
Expand Down