1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

use proc instead of Thread. [ruby-dev:33692]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
seki 2008-03-23 16:27:20 +00:00
parent a4c6fb81bb
commit d22a07baa8
2 changed files with 7 additions and 4 deletions

View file

@ -729,13 +729,12 @@ class ERB
#
def result(b=TOPLEVEL_BINDING)
if @safe_level
th = Thread.start {
proc {
$SAFE = @safe_level
eval(@src, b, (@filename || '(erb)'), 1)
}
return th.value
}.call
else
return eval(@src, b, (@filename || '(erb)'), 1)
eval(@src, b, (@filename || '(erb)'), 1)
end
end