Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add test for stack trace mapping #168017

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

srujzs
Copy link
Contributor

@srujzs srujzs commented Apr 29, 2025

The bootstrap script utilizes a DDC utility function that maps paths to their module name in order for the stack traces to show the Dart paths and not the JS paths. This gets utilized in some stack tracing functionalities like StackTrace.current. We should test that the mapping is correct and we expect the correct stack traces.

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
  • All existing and new tests are passing.

Once we have the CL to emit inlined source maps for the DDC library bundle format landed, we can fork this test and run it with that format as well.

The bootstrap script utilizes a DDC utility function that
maps paths to their module name in order for the stack traces
to show the Dart paths and not the JS paths. This gets utilized
in some stack tracing functionalities like StackTrace.current.
We should test that the mapping is correct and we expect the
correct stack traces.
@srujzs srujzs requested a review from nshahan April 29, 2025 21:43
@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Apr 29, 2025
Copy link
Contributor

@nshahan nshahan left a comment

Choose a reason for hiding this comment

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

LGTM with one question about the stack frames.

@srujzs
Copy link
Contributor Author

srujzs commented May 1, 2025

I updated the test to use a regex to check for the SDK stack frame so we know we're getting a Dart file and not a JS file (as get current appears in both stack traces).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants