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

Add an instrument option to disable generation of native block bodies #89

Merged
merged 2 commits into from
Oct 15, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/liquid/c.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ def new_block_body
def disable_liquid_c_nodes
# Liquid::Profiler exposes the internal parse tree that we don't want to build when
# parsing with liquid-c, so consider liquid-c to be disabled when using it.
@disable_liquid_c_nodes ||= !Liquid::C.enabled || @template_options[:profile]
# Also, some templates are parsed before the profiler is running, on which case we
# provide the `disable_liquid_c_nodes` option to enable the Ruby AST to be produced
# so the profiler can use it on future runs.
@disable_liquid_c_nodes ||= !Liquid::C.enabled || @template_options[:profile] || @template_options[:disable_liquid_c_nodes]
end
end

Expand Down