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
Unfreeze string literals for ParseNode#inspect #1016
Unfreeze string literals for ParseNode#inspect #1016
Conversation
1ea26c4
to
bc88181
Compare
@jalyna Thank you for the patch! |
@amatsuda this is a really good question! the second # frozen_string_literal: true
puts %Q[hello world].frozen? prints true. We could also use something else here |
@jalyna Ah! I just got what you meant by "which are recursively called". Thank you for a clear explanation (and I'm sorry that I wasn't carefully reading it...)! |
@jalyna Just published version 5.1.2 gem with this patch. Thanks! |
Update ruby-haml to 5.1.2. pkgsrc change: add "USE_LANGUAGES= # none". ## 5.1.2 Released on August 6, 2019 ([diff](haml/haml@v5.1.1...v5.1.2)). * Fix crash in some environments such as New Relic by unfreezing string literals for ParseNode#inspect. [#1016](haml/haml#1016) (thanks [Jalyna](https://github.com/jalyna)) ## 5.1.1 Released on May 25, 2019 ([diff](haml/haml@v5.1.0...v5.1.1)). * Fix NameError bug for that happens on ruby 2.6.1-2.6.3 + haml 5.1.0 + rails 4.2.x + erubi. (Akira Matsuda) ## 5.1.0 Released on May 16, 2019 ([diff](haml/haml@v5.0.4...v5.1.0)). * Rails 6 support [#1008](haml/haml#1008) (thanks [Seb Jacobs](https://github.com/sebjacobs)) * Add `escape_filter_interpolations` option for backwards compatibility with haml 4 defaults [#984](haml/haml#984) (thanks [Will Jordan](https://github.com/wjordan)) * Fix error on empty :javascript and :css filter blocks [#986](haml/haml#986) (thanks [Will Jordan](https://github.com/wjordan)) * Respect changes in Haml::Options.defaults in `Haml::TempleEngine` options (Takashi Kokubun) * Un-freeze TempleEngine precompiled string literals [#983](haml/haml#983) (thanks [Will Jordan](https://github.com/wjordan)) * Various performance/memory improvements [#965](haml/haml#965), [#966](haml/haml#966), [#963](haml/haml#963) (thanks [Dillon Welch](https://github.com/oniofchaos)) * Enable `frozen_string_literal` magic comment for all .rb files [#967](haml/haml#967) (thanks [Dillon Welch](https://github.com/oniofchaos))
Since newrelic is using the
#inspect
method onParseNode
the ruby code crashes due to frozen strings ininspect
, which are recursively called withgsub!
causing this error:I added a regression test that fails with the current code.