mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* iseq.c (set_relation): do not use top_wrapper as bottom of cref,
which caused constant lookup error when "wrapped load" is used; instead, use Object as bottom, and push top_wrapper on Object. [ruby-core:25039] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4af243a8af
commit
e02f7f79c2
3 changed files with 28 additions and 1 deletions
|
@ -197,6 +197,19 @@ class TestRequire < Test::Unit::TestCase
|
|||
assert_raise(ArgumentError) { at_exit }
|
||||
end
|
||||
|
||||
def test_load2 # [ruby-core:25039]
|
||||
t = Tempfile.new(["test_ruby_test_require", ".rb"])
|
||||
t.puts "Hello = 'hello'"
|
||||
t.puts "class Foo"
|
||||
t.puts " p Hello"
|
||||
t.puts "end"
|
||||
t.close
|
||||
|
||||
assert_in_out_err([], <<-INPUT, %w("hello"), [])
|
||||
load(#{ t.path.dump }, true)
|
||||
INPUT
|
||||
end
|
||||
|
||||
def test_tainted_loadpath
|
||||
t = Tempfile.new(["test_ruby_test_require", ".rb"])
|
||||
abs_dir, file = File.split(t.path)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue