Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Debug implementations for js_sys::* #1157

Closed
derekdreery opened this issue Jan 7, 2019 · 3 comments
Closed

Custom Debug implementations for js_sys::* #1157

derekdreery opened this issue Jan 7, 2019 · 3 comments

Comments

@derekdreery
Copy link
Contributor

It would be nice when debugging if you could get more information about the contents of a javascript object, etc. Debug could be implemented to iterate over its own properties and use f.debug_map to print them.

Same applies to other built-in javascript objects.

@alexcrichton
Copy link
Contributor

This sounds like a great idea to me, and I think we could take a PR for these at any time!

@derekdreery
Copy link
Contributor Author

I've implemented something in #1161, I'm seeing how it works out in practice and it seems to be good.

It basically tries to json-encode the object, and if that's not possible use toString to get something.

@alexcrichton
Copy link
Contributor

We've already added a few of these so I'm going to close this, and more are of course welcome at any time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants