File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
test/truffle/compiler/pe/core Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 6
6
# GNU General Public License version 2, or
7
7
# GNU Lesser General Public License version 2.1.
8
8
9
+ module BindingFixtures
10
+ def self . yielder
11
+ yield
12
+ end
13
+ end
14
+
9
15
# Kernel#binding
10
16
example "x = 14; binding.local_variable_get(:x)" , 14
11
17
23
29
example "b = binding.dup; b.local_variable_set(:x, 14); b.local_variable_get(:x)" , 14
24
30
25
31
# get (2 levels)
26
- example "x = 14; y = nil; 1.times { y = binding.local_variable_get(:x) }; y" , 14
32
+ example "x = 14; y = nil; BindingFixtures.yielder { y = binding.local_variable_get(:x) }; y" , 14
27
33
28
34
# set (2 levels)
29
- example "x = nil; 1.times { binding.local_variable_set(:x, 15) }; x" , 15
35
+ example "x = nil; BindingFixtures.yielder { binding.local_variable_set(:x, 15) }; x" , 15
30
36
31
37
# get + set (2 levels)
32
- example "x = 14; y = nil; 1.times { binding.local_variable_set(:x, 15); y = binding.local_variable_get(:x) }; y" , 15
38
+ example "x = 14; y = nil; BindingFixtures.yielder { binding.local_variable_set(:x, 15); y = binding.local_variable_get(:x) }; y" , 15
33
39
34
40
# defined
35
41
You can’t perform that action at this time.
0 commit comments