-
Notifications
You must be signed in to change notification settings - Fork 187
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
Sprockets test_compile_erb_template_that_depends_on_env test fails #2810
Comments
* This should help catching concurrency issues much faster. * Notably, the two issues of rails#772 reproduce by running the test suite on TruffleRuby. * Skip tests which do not pass yet on TrufffleRuby. oracle/truffleruby#2810
It'd be good to also fix this |
A simplified example to reproduce the issue: require 'erb'
C = 1
class A
end
a = A.new
klass = (class << a; self; end)
klass.const_set(:C, 2)
engine = ERB.new('<%= C %>')
puts engine.result(a.instance_eval('binding')) Results:
|
A bit simpler example (without C = 1
class A
C = 2
end
a = A.new
puts a.instance_eval("C") |
I see, so then we need to add the receiver of instance_eval first in constant lookup, i.e. a LexicalScope object |
C = 1
class A
C = 2
end
a = A.new
a.singleton_class.const_set(:C, 3)
puts a.instance_eval("C") # => 3 |
Fixed in f911355. |
These 2 tests fail, it's unclear why.
https://github.com/rails/sprockets/blob/1276b431e2e4c1099dae1b3ff76adc868c863ddd/test/test_erb_processor.rb#L31
https://github.com/rails/sprockets/blob/1276b431e2e4c1099dae1b3ff76adc868c863ddd/test/test_erb_processor.rb#L56
https://github.com/rails/sprockets/blob/1276b431e2e4c1099dae1b3ff76adc868c863ddd/lib/sprockets/erb_processor.rb#L30 is what should track ENV accesses.
The text was updated successfully, but these errors were encountered: