Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix warning when using yield in templates on ruby 2.7
Take the class of the scope, and pass it through the compilation methods. Call class_eval on the scope's class so that constant lookup works, and switch the singleton class opening to instance_exec. This radically simplifies the compiled template method code, and I would guess it speeds it up significantly as well. However, this approach can cause a memory leak if you are creating anonymous classes at runtime and then passing instances of those classes as the scope of the render.
- Loading branch information
1 parent
a7e0018
commit dbb4df9
Showing
1 changed file
with
7 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters