Skip to content

Commit ba94904

Browse files
authored
Support legacy namespaces for enums (#2144)
1 parent c059d14 commit ba94904

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

inputfiles/overridingTypes.jsonc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -347,12 +347,6 @@
347347
},
348348
"enums": {
349349
"enum": {
350-
"ImportExportKind": {
351-
"legacyNamespace": "WebAssembly"
352-
},
353-
"TableKind": {
354-
"legacyNamespace": "WebAssembly"
355-
},
356350
"ImageOrientation": {
357351
"value": [
358352
// The spec removed this but it's still in browsers and WebKit doesn't support the new one.

inputfiles/patches/webassembly.kdl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
enum ImportExportKind legacyNamespace=WebAssembly
2+
enum TableKind legacyNamespace=WebAssembly

src/build/patches.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,15 @@ function handleEnum(node: Node): Enum {
7676
values.push(child.name);
7777
}
7878

79-
return { name, value: values };
79+
return {
80+
name,
81+
value: values,
82+
...optionalMember(
83+
"legacyNamespace",
84+
"string",
85+
node.properties.legacyNamespace,
86+
),
87+
};
8088
}
8189

8290
/**

0 commit comments

Comments
 (0)