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

TracePoint.new(:end) is not supported #3696

Open
segiddins opened this issue Oct 22, 2024 · 6 comments
Open

TracePoint.new(:end) is not supported #3696

segiddins opened this issue Oct 22, 2024 · 6 comments

Comments

@segiddins
Copy link

It is called on cruby when a class or module block is closed

@andrykonchin
Copy link
Member

Thank you for the report, we'll look into it.

@eregon
Copy link
Member

eregon commented Oct 23, 2024

Do you need it for a particular gem or usage?

@segiddins
Copy link
Author

Yes, joeldrapper/literal uses it to "freeze" classes once they're done being defined

@joeldrapper
Copy link

@eregon thank you. I replied to your comments in the thread on the literal repo. I think we can just disable this feature for TruffleRuby. It’s not essential, it’s just nice to know that Enums are constant — defined once at boot and never updated during runtime.

@eregon
Copy link
Member

eregon commented Oct 28, 2024

I think we can just disable this feature for TruffleRuby.

That would be nice.
A good way to detect that is:

has_end_tracepoint = begin
  TracePoint.new(:end) {}
  true
rescue ArgumentError
  false
end

In terms of priority, implementing TracePoint.new(:end) {} is fairly low at this point, because it seems rarely used, non-trivial effort and there are simply more important compatibility issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants