Projects
Factory:RISC-V:Ruby
rubygem-contracts
_service:tar_scm:rubygem-contracts-0.16.0-0004-...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:rubygem-contracts-0.16.0-0004-Wrapping-blocks-only-when-there-is-a-Func-check.-bug.patch of Package rubygem-contracts
From ab30dab081c4e004812eab00a36c70e5b8e4e29b Mon Sep 17 00:00:00 2001 From: md-work <> Date: Thu, 14 Dec 2017 11:37:18 +0100 Subject: [PATCH 4/5] Wrapping &blocks only when there is a Func check. (bug 278) --- lib/contracts/call_with.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/contracts/call_with.rb b/lib/contracts/call_with.rb index c9336a1..9252c79 100644 --- a/lib/contracts/call_with.rb +++ b/lib/contracts/call_with.rb @@ -81,8 +81,10 @@ module Contracts method.call(*args, &blk) else # original method name reference - added_block = blk ? lambda { |*params| blk.call(*params) } : nil - method.send_to(this, *args, &added_block) + # Don't reassign blk, else Travis CI shows "stack level too deep". + target_blk = blk + target_blk = lambda { |*params| blk.call(*params) } if blk && blk.is_a?(Contract) + method.send_to(this, *args, &target_blk) end unless @ret_validator[result] -- 2.29.2
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2