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

feat(core): cleaner opcall stack traces #12358

Merged
merged 3 commits into from
Oct 7, 2021

Conversation

AaronO
Copy link
Contributor

@AaronO AaronO commented Oct 7, 2021

Avoid leaking core JS internals in opcall stack traces.

Before:

> await Deno.read(42, new Uint8Array(10));
Uncaught BadResource: Bad resource ID
    at deno:core/01_core.js:101:46
    at unwrapOpResult (deno:core/01_core.js:121:13)
    at async Object.read (deno:runtime/js/12_io.js:105:19)
    at async <anonymous>:5:5

After:

> await Deno.read(42, new Uint8Array(10));
Uncaught BadResource: Bad resource ID
    at async Object.read (deno:runtime/js/12_io.js:105:19)
    at async <anonymous>:5:5

Before:
```
BadResource: Bad resource ID
    at deno:core/01_core.js:101:46
    at unwrapOpResult (deno:core/01_core.js:121:13)
    at async Object.read (deno:runtime/js/12_io.js:105:19)
    at async <anonymous>:5:5
```

After:
```
BadResource: Bad resource ID
    at async Object.read (deno:runtime/js/12_io.js:105:19)
    at async <anonymous>:5:5
```
Copy link
Collaborator

@nayeemrmn nayeemrmn left a comment

Choose a reason for hiding this comment

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

LGTM. Stopping at the core.opAsync() call site seems fine and the stack frame above that isn't reflective of what was called anyway.

@AaronO AaronO merged commit 370c27e into denoland:main Oct 7, 2021
@AaronO AaronO deleted the feat/core-cleaner-stack-traces branch October 7, 2021 16:39
bartlomieju pushed a commit to bartlomieju/deno that referenced this pull request Oct 10, 2021
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.

3 participants