import drb-2.0.4 (use LocalJumpeError#reason)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
seki 2003-06-28 22:03:41 +00:00
Родитель 3d4c49ee3b
Коммит d5f31755fc
3 изменённых файлов: 8 добавлений и 56 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Sun Jun 29 06:59:07 2003 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/drb/drb.rb, lib/drb/invokemethod.rb: import drb-2.0.4
(use LocalJumpError#reason)
Sat Jun 28 12:28:54 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net> Sat Jun 28 12:28:54 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* configure.in (rb_cv_stack_grow_dir): check stack growing direction. * configure.in (rb_cv_stack_grow_dir): check stack growing direction.

Просмотреть файл

@ -689,17 +689,6 @@ module DRb
end end
end end
def rescue_local_jump(err)
case err.message
when /^retry/ # retry from proc-closure
return :retry
when /^break/ # break from proc-closure
return rescue_break(err)
else
return :unknown
end
end
end end
if RUBY_VERSION >= '1.8' if RUBY_VERSION >= '1.8'
@ -708,43 +697,7 @@ module DRb
include InvokeMethod18Mixin include InvokeMethod18Mixin
end end
else else
module InvokeMethod16Mixin require 'drb/invokemethod16'
def block_yield(x)
if x.class == Array
block_value = @block.__drb_yield(*x)
else
block_value = @block.__drb_yield(x)
end
end
def rescue_break(err)
return :break
end
def perform_with_block
@obj.__send__(@msg_id, *@argv) do |x|
jump_error = nil
begin
block_value = block_yield(x)
rescue LocalJumpError
jump_error = $!
end
if jump_error
reason ,= rescue_local_jump(jump_error)
case reason
when :retry
retry
when :break
break
else
raise jump_error
end
end
block_value
end
end
end
class InvokeMethod class InvokeMethod
include InvokeMethod16Mixin include InvokeMethod16Mixin
end end

Просмотреть файл

@ -1,4 +1,3 @@
# for ruby-1.8.0 # for ruby-1.8.0
module DRb module DRb
@ -8,10 +7,6 @@ module DRb
block_value = @block.call(*x) block_value = @block.call(*x)
end end
def rescue_break(err)
return :break, err.exit_value
end
def perform_with_block def perform_with_block
@obj.__send__(@msg_id, *@argv) do |*x| @obj.__send__(@msg_id, *@argv) do |*x|
jump_error = nil jump_error = nil
@ -21,12 +16,11 @@ module DRb
jump_error = $! jump_error = $!
end end
if jump_error if jump_error
reason, jump_value = rescue_local_jump(jump_error) case jump_error.reason
case reason
when :retry when :retry
retry retry
when :break when :break
break(jump_value) break(jump_error.exit_value)
else else
raise jump_error raise jump_error
end end