wasm-bindgen
wasm-bindgen copied to clipboard
Apply only allowed attributes to generated functions
This is a response to #3315. @daxpedda suggested that we pass down specific attributes and then allow the user to specify additional allowed attributes that could be attached to the bindgen and descriptor functions.
This is an initial implementation of the first part of this idea, namely, that only the cfg
and cfg_attr
attributes are allowed to be passed through. There may be others that should be allowed by default, but since these are involved in conditional compilation, I felt they would be most relevant to apply to the generated functions.
I'm mostly looking for feedback on the direction here before I dive too much deeper. Thanks!