Commit f1f48250

f1f48250fdb0Merged

Yukihiro "Matz" Matsumoto <[email protected]> · 6 months ago · 8 files · +2 added · ~6 modified

Description

Merge pull request #491 from ydah/fix/zero-truthiness

fix(codegen): use ruby truthiness for scalar conditions

Details

Commit
f1f48250fdb0
Parent
043ef65b49bb
Merge parent
669739cdfcf7

spinel_analyze.rbmodifiedView file

@@ -2585,6 +2585,12 @@
25852585 mname = @nd_name[nid]
25862586 recv = @nd_receiver[nid]
25872587
2588+ if mname == "block_given?"
2589+ if recv < 0 || (recv >= 0 && @nd_type[recv] == "SelfNode")
2590+ return "bool"
2591+ end
2592+ end
2593+
25882594 # Methods on a `rescue => e` bound exception variable. The variable
25892595 # itself is string-typed but .class / .message / .to_s / .inspect /
25902596 # .full_message return strings; .backtrace returns nil for now.