wasm-bindgen/crates/macro-support
Katie df34cf843e Allow for js property inspection (#1876)
* Add support for #[wasm_bindgen(inspectable)]

This annotation generates a `toJSON` and `toString` implementation for
generated JavaScript classes which display all readable properties
available via the class or its getters

This is useful because wasm-bindgen classes currently serialize to
display one value named `ptr`, which does not model the properties of
the struct in Rust

This annotation addresses rustwasm/wasm-bindgen#1857

* Support console.log for inspectable attr in Nodejs

`#[wasm_bindgen(inspectable)]` now generates an implementation of
`[util.inspect.custom]` for the Node.js target only. This implementation
causes `console.log` and friends to yield the same class-style output,
but with all readable fields of the Rust struct displayed

* Reduce duplication in generated methods

Generated `toString` and `[util.inspect.custom]` methods now call
`toJSON` to reduce duplication

* Store module name in variable
2019-11-26 12:39:57 -06:00
..
src Allow for js property inspection (#1876) 2019-11-26 12:39:57 -06:00
Cargo.toml Bump to 0.2.55 (#1864) 2019-11-19 11:04:37 -06:00
LICENSE-APACHE Move the macro support code into its own crate (#529) 2018-07-29 08:59:46 -07:00
LICENSE-MIT Move the macro support code into its own crate (#529) 2018-07-29 08:59:46 -07:00