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

Use deno_core::JSError in deno #1855

Merged
merged 4 commits into from
Feb 28, 2019
Merged

Use deno_core::JSError in deno #1855

merged 4 commits into from
Feb 28, 2019

Conversation

ry
Copy link
Member

@ry ry commented Feb 28, 2019

src/js_errors.rs takes care of source maps and color while
core/js_errors.rs is just the basic struct.

src/js_errors.rs takes care of source maps and color while
core/js_errors.rs is just the basic struct.
@ry ry requested a review from piscisaureus February 28, 2019 14:32
Copy link
Member

@piscisaureus piscisaureus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Un-enthousiastic LGTM.
struct JSErrorColor seems fishy to me and duplicates code between core and that root crate. I think this should be done by adding a different trait but I'm unsure how.

@ry
Copy link
Member Author

ry commented Feb 28, 2019

I also am not super happy with it, but wrapping was the suggested (actually only) way of modifying a Display on a struct.
See https://users.rust-lang.org/t/reusing-an-fmt-formatter/8531/4

I could of course shadow the original name in src/ instead of calling it JSErrorColor, but I think this is less explicit and confusing. Also users won't be able to access member information.

@ry ry merged commit b3b989f into denoland:master Feb 28, 2019
@ry ry deleted the core_js_errors branch February 28, 2019 21:19
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

Successfully merging this pull request may close these issues.

None yet

2 participants