Skip to content

Commit

Permalink
nitin: use the new frame read/write API
Browse files Browse the repository at this point in the history
Signed-off-by: Jean Privat <[email protected]>
  • Loading branch information
privat committed Aug 22, 2024
1 parent 09c3e97 commit ca96c97
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions contrib/nitin/nitin.nit
Original file line number Diff line number Diff line change
Expand Up @@ -145,20 +145,19 @@ redef class AMethPropdef
if injected_variables == null then return super

# Inject main variables in the frame
assert f isa InterpreterFrame
for variable, i in injected_variables do
f.map[variable] = i
f.write_variable(variable, v, i)
end

var res = super

# Update the values of the variables
for variable in injected_variables.keys do
injected_variables[variable] = f.map[variable]
injected_variables[variable] = f.read_variable(variable, v)
end
# Retrieve the values of the new main variables
for variable in new_variables.as(not null) do
injected_variables[variable] = f.map[variable]
injected_variables[variable] = f.read_variable(variable, v)
end

return res
Expand Down

0 comments on commit ca96c97

Please sign in to comment.