Skip to content

Commit

Permalink
Clear E2's strfunc cache when defining a function
Browse files Browse the repository at this point in the history
Previously the following code:
    function string f() { print("A") }
    "f"()
    function string f() { print("B") }
    "f"()

...would print "A" twice, because the previous entry for "f()" was still
present in the cache.

Fixes #1612.
  • Loading branch information
AbigailBuccaneer committed Jun 6, 2018
1 parent 2e49f70 commit 2496129
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lua/entities/gmod_wire_expression2/core/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ __e2setcost(1)
registerOperator("function", "", "", function(self, args)
local sig, body = args[2], args[3]
self.funcs[sig] = body
self.strfunc_cache = {}
end)

__e2setcost(2)
Expand Down

0 comments on commit 2496129

Please sign in to comment.