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
..
2019-04-08 10:40:46 -07:00
2019-04-08 10:40:46 -07:00
2019-03-14 08:46:42 -03:00
2019-03-14 08:46:42 -03:00
2018-09-26 08:26:00 -07:00
2019-06-05 07:52:14 -07:00
2019-09-20 13:50:00 -05:00
2018-08-06 11:46:23 -07:00
2018-09-26 08:26:00 -07:00
2018-09-26 08:26:00 -07:00
2018-09-26 08:26:00 -07:00
2018-11-09 08:00:41 -08:00
2018-11-09 08:00:41 -08:00
2019-10-28 20:15:05 -07:00
2019-05-28 09:52:44 -05:00
2019-09-25 11:24:48 -05:00
2018-08-06 10:06:45 -07:00
2018-09-26 08:26:00 -07:00
2018-09-26 08:26:00 -07:00
2018-09-26 08:26:00 -07:00
2019-05-13 08:12:32 -07:00
2019-10-28 20:15:05 -07:00
2019-04-12 08:56:36 -07:00
2019-04-12 08:56:36 -07:00
2018-08-04 22:25:29 -05:00
2018-09-26 08:26:00 -07:00
2018-09-26 08:26:00 -07:00