Ruby: Fix rack response tracking

Use type tracking instead of getReturningNode, which seems to be faster
and works correctly for the cases I've tried.
This commit is contained in:
Harry Maclean
2023-01-23 21:43:04 +00:00
parent 21ce9b448a
commit c1207e0938
3 changed files with 33 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
| rack.rb:1:1:5:3 | HelloWorld | rack.rb:2:12:2:14 | env |
| rack.rb:7:1:16:3 | Proxy | rack.rb:12:12:12:18 | the_env |
| rack.rb:18:1:31:3 | Logger | rack.rb:24:12:24:14 | env |
| rack.rb:45:1:61:3 | Baz | rack.rb:46:12:46:14 | env |

View File

@@ -41,3 +41,21 @@ class Bar
nil
end
end
class Baz
def call(env)
run(env)
end
def run(env)
if env[:foo] == "foo"
[200, {}, "foo"]
else
error
end
end
def error
[400, {}, "nope"]
end
end