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

chore(ext/console): add 'quotes' internal option to Deno.inspect #18183

Merged
merged 5 commits into from
Mar 17, 2023

Conversation

kt3k
Copy link
Member

@kt3k kt3k commented Mar 14, 2023

This adds quotes (internal) option to InspectOptions and makes Deno.inspect optionally compatible to util.inspect of Node.

This prepares for #17960

@kt3k kt3k requested review from ry and bartlomieju March 14, 2023 10:50
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@aapoalas aapoalas left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Member

@littledivy littledivy left a comment

Choose a reason for hiding this comment

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

This should be a symbol exposed to node:util via __bootstrap namespace (and not userland). We do something similar in ext/web for hidden options for Event class

const { _quotes } = __bootstrap.console;
Deno.inspect(..., { [_quotes]: ["'"] });

@kt3k
Copy link
Member Author

kt3k commented Mar 16, 2023

@littledivy

This should be a symbol exposed to node:util via __bootstrap namespace (and not userland). We do something similar in ext/web for hidden options for Event class

Sounds a good idea, but how to write a unit test in that case?

@bartlomieju
Copy link
Member

@littledivy

This should be a symbol exposed to node:util via __bootstrap namespace (and not userland). We do something similar in ext/web for hidden options for Event class

Sounds a good idea, but how to write a unit test in that case?

There's no way, you'd need to assign it to Deno[Deno.internal] namespace to write a test

@kt3k
Copy link
Member Author

kt3k commented Mar 16, 2023

Added a TODO comment above the option name for now.

@kt3k kt3k merged commit e30d24b into denoland:main Mar 17, 2023
@kt3k kt3k deleted the chore-inspect-quotes branch March 17, 2023 03:22
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

4 participants