Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
44 changes: 0 additions & 44 deletions inputfiles/addedTypes.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -952,50 +952,6 @@
}
}
}
},
"ValueTypeMap": {
"name": "ValueTypeMap",
"legacyNamespace": "WebAssembly",
"exposed":"Window Worker Worklet",
"members": {
"member": {
"anyfunc": {
"name": "anyfunc",
"overrideType": "Function",
"required": 1
},
"externref": {
"name": "externref",
"overrideType": "any",
"required": 1
},
"f32": {
"name": "f32",
"overrideType": "number",
"required": 1
},
"f64": {
"name": "f64",
"overrideType": "number",
"required": 1
},
"i32": {
"name": "i32",
"overrideType": "number",
"required": 1
},
"i64": {
"name": "i64",
"overrideType": "bigint",
"required": 1
},
"v128": {
"name": "v128",
"overrideType": "never",
"required": 1
}
}
}
}
}
},
Expand Down
9 changes: 9 additions & 0 deletions inputfiles/patches/values.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dictionary ValueTypeMap legacyNamespace="WebAssembly" exposed="Window Worker Worklet" {
Copy link
Contributor

Choose a reason for hiding this comment

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

The existing webassembly.kdl seems like the best place to put this.

member anyfunc required=#true type="Function"
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to quote types nor legacyNamespace.

member externref required=#true type="any"
member f32 required=#true type="long"
member f64 required=#true type="long"
member i32 required=#true type="long"
member i64 required=#true type="bigint"
member v128 required=#true type="never"
}
17 changes: 4 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/build/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ const sameTypes = new Set([
"PromiseLike",
"undefined",
"void",
"bigint",
"never",
Copy link
Contributor

Choose a reason for hiding this comment

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

never is not an IDL type, please use overrideType for that. bigint is, though.

]);
export const baseTypeConversionMap = new Map<string, string>([
...[...bufferSourceTypes].map((type) => [type, type] as const),
Expand Down
6 changes: 6 additions & 0 deletions src/build/patches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,12 @@ function handleDictionary(child: Node): DeepPartial<Dictionary> {
return {
name,
members: { member },
...optionalMember("extends", "string", child.properties?.extends),
Copy link
Contributor

Choose a reason for hiding this comment

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

This line can be skipped for now, as we are not using "extends" here. You might have intended to do "exposed" but...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, fixed it

...optionalMember(
"legacyNamespace",
"string",
child.properties?.legacyNamespace,
),
};
}

Expand Down