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

Support custom inspection of objects #2791

Merged
merged 2 commits into from Aug 19, 2019

Conversation

@kitsonk
Copy link
Contributor

commented Aug 18, 2019

Resolves #2775

This PR adds support for custom inspection, introducing a symbol to allow it. For example, the following:

class Foo {
  [Deno.customInspect]() {
    return "bar";
  }
}

console.log(new Foo()); // logs `bar`

This will give users the ability to make inspection and logging more meaningful.

@kitsonk kitsonk force-pushed the kitsonk:console-custom-inspect branch from 49c5633 to 5588019 Aug 18, 2019

@ry
ry approved these changes Aug 19, 2019
Copy link
Collaborator

left a comment

LGTM

@ry ry merged commit f0a2355 into denoland:master Aug 19, 2019

3 checks passed

Travis CI - Pull Request Build Passed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
license/cla Contributor License Agreement is signed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.