Skip to content

Remove add_feature from ensure block#1810

Merged
dbussink merged 1 commit intorubinius:masterfrom
LTe:require_compiled
Jul 13, 2012
Merged

Remove add_feature from ensure block#1810
dbussink merged 1 commit intorubinius:masterfrom
LTe:require_compiled

Conversation

@LTe
Copy link
Copy Markdown
Contributor

@LTe LTe commented Jul 13, 2012

When require method raise LoadError @feature instance is not set.
We need to check also check that req local variable is set. Because
require method could raise exception.

Before patch

rubinius-2.0.0dev :001 > Rubinius::CodeLoader.require_compiled("lib")
NoMethodError: undefined method `suffix?' on nil:NilClass.
    from kernel/delta/kernel.rb:81:in `suffix? (method_missing)'
    from kernel/delta/codeloader.rb:76:in `add_feature'
    from kernel/delta/codeloader.rb:45:in `require_compiled'
    from kernel/delta/codeloader.rb:105:in `require_compiled'
    from (irb):1
    from kernel/common/block_environment.rb:75:in `call_on_instance'
    from kernel/common/eval.rb:72:in `eval'
    from kernel/common/kernel19.rb:42:in `loop'
    from kernel/common/throw_catch19.rb:8:in `catch'
    from kernel/common/throw_catch.rb:10:in `register'
    from kernel/common/throw_catch19.rb:7:in `catch'
    from kernel/common/throw_catch19.rb:8:in `catch'
    from kernel/common/throw_catch.rb:10:in `register'
    from kernel/common/throw_catch19.rb:7:in `catch'
    from kernel/common/codeloader.rb:207:in `require'
    from kernel/common/kernel.rb:631:in `gem_original_require (require)'
    from /home/lite/.rvm/rubies/rbx-head/lib/rubygems/custom_require.rb:36:in `require'
    from kernel/loader.rb:706:in `irb'
    from kernel/loader.rb:845:in `main'rubinius-2.0.0dev :002 > 

After patch

rbx-head :001 > Rubinius::CodeLoader.require_compiled("lib")
LoadError: no such file to load -- lib
    from kernel/common/codeloader.rb:390:in `load_error'
    from kernel/common/codeloader.rb:377:in `resolve_require_path'
    from kernel/common/codeloader.rb:104:in `require'
    from kernel/bootstrap/rubinius.rb:145:in `synchronize'
    from kernel/common/codeloader.rb:103:in `require'
    from kernel/delta/codeloader.rb:37:in `require_compiled'
    from kernel/delta/codeloader.rb:106:in `require_compiled'
    from (irb):1
    from kernel/common/block_environment.rb:75:in `call_on_instance'
    from kernel/common/eval.rb:72:in `eval'
    from kernel/common/kernel19.rb:42:in `loop'
    from kernel/common/throw_catch19.rb:8:in `catch'
    from kernel/common/throw_catch.rb:10:in `register'
    from kernel/common/throw_catch19.rb:7:in `catch'
    from kernel/common/throw_catch19.rb:8:in `catch'
    from kernel/common/throw_catch.rb:10:in `register'
    from kernel/common/throw_catch19.rb:7:in `catch'
    from kernel/common/codeloader.rb:212:in `require'
    from kernel/common/kernel.rb:631:in `gem_original_require (require)'
    from /home/lite/work/rubinius/lib/rubygems/custom_require.rb:36:in `require'
    from kernel/loader.rb:698:in `irb'
    from kernel/loader.rb:836:in `main'rbx-head :002 > 

When require method raise LoadError @feature instance is not set.
We need to check also check that req local variable is set. Because
require method could raise exception.
dbussink added a commit that referenced this pull request Jul 13, 2012
Remove add_feature from ensure block
@dbussink dbussink merged commit 19beee4 into rubinius:master Jul 13, 2012
@travisbot
Copy link
Copy Markdown

This pull request passes (merged f590a9d into f2cb8fc).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants