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

Implement console.trace() method #3808

Closed
HalidOdat opened this issue Apr 14, 2024 · 8 comments
Closed

Implement console.trace() method #3808

HalidOdat opened this issue Apr 14, 2024 · 8 comments
Assignees
Labels
E-Easy Easy enhancement New feature or request good first issue Good for newcomers

Comments

@HalidOdat
Copy link
Member

HalidOdat commented Apr 14, 2024

Specification: https://console.spec.whatwg.org/#trace
MDN Documentation: https://developer.mozilla.org/en-US/docs/Web/API/console/trace_static

@HalidOdat HalidOdat changed the title trace() Implement console.trace() method Apr 14, 2024
@HalidOdat HalidOdat added enhancement New feature or request good first issue Good for newcomers E-Easy Easy labels Apr 14, 2024
@hunterchen7
Copy link

could I give this a go?

@HalidOdat
Copy link
Member Author

could I give this a go?

Sure :)

@nekevss
Copy link
Member

nekevss commented May 25, 2024

@HalidOdat Stack traces came up in discord. I don't think I had paid attention too much (EDIT: to the current state of the implementation). Where were we in regards to the implementation of stack traces?

@hunterchen7
Copy link

@HalidOdat Stack traces came up in discord. I don't think I had paid attention too much. Where were we in regards to the implementation of stack traces?

It was me who asked the question in the discord, thank you for the reply there!

@HalidOdat
Copy link
Member Author

Currently the only thing we can get is the function names of the trace from the call stack.

But I think just printing the names is good enough for now, and we can create an issue for improving the console.trace() and add line and column numbers once we store them somewhere.

@hunterchen7
Copy link

Currently the only thing we can get is the function names of the trace from the call stack.

But I think just printing the names is good enough for now, and we can create an issue for improving the console.trace() and add line and column numbers once we store them somewhere.

There's already a barebones implementation that prints out the function names so I thought this issue would be improving it by adding locations and such, does that mean I should leave it alone for now?

@HalidOdat
Copy link
Member Author

HalidOdat commented May 28, 2024

I see, the issue does not seem to be up to date with the implementation, In that case I would close this issue for now, to get line number requires more work, mainly:

  • adding position information to the AST (at least a Position to the Expr). Span nodes #300
  • Adding some compact format of position information to CodeBlock.
  • Adjusting the ByteCompiler to emit this position information.

Each one of these issues deserves a PR 😅

EDIT: If your interested in working on any of these, feel free to ask about them :)

@HalidOdat
Copy link
Member Author

Closing because there is already a basic implementation of console.trace().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-Easy Easy enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants