Add original field name to wasm macro.

This commit is contained in:
Tom Alexander
2023-12-25 12:32:35 -05:00
parent bbb9ec637a
commit eb51bdfe2f
59 changed files with 96 additions and 15 deletions

View File

@@ -2,7 +2,7 @@
///
/// This exists to make changing the type signature easier.
macro_rules! to_wasm {
($ostruct:ty, $istruct:ty, $wasm_context:ident, $standard_properties:ident, $fnbody:tt) => {
($ostruct:ty, $istruct:ty, $original:ident, $wasm_context:ident, $standard_properties:ident, $fnbody:tt) => {
impl<'s> ToWasm for $istruct {
type Output = $ostruct;
@@ -10,6 +10,7 @@ macro_rules! to_wasm {
&self,
$wasm_context: crate::wasm::to_wasm::ToWasmContext<'_>,
) -> Result<Self::Output, crate::error::CustomError> {
let $original = self;
let $standard_properties = self.to_wasm_standard_properties($wasm_context)?;
$fnbody
}