From 4ffc2206eeea4a7d58bdf283e35cdf28b29b0b42 Mon Sep 17 00:00:00 2001 From: Dmytro Maluka Date: Mon, 13 Nov 2023 18:17:58 +0100 Subject: [PATCH] Don't expose Go timers directly to lua Since we now expose our own micro.After() API which is more convenient and safer to use than directly using Go timers, we can remove exposing Go timers to lua directly. --- internal/lua/lua.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/internal/lua/lua.go b/internal/lua/lua.go index 3ce9472f..d7af16b0 100644 --- a/internal/lua/lua.go +++ b/internal/lua/lua.go @@ -523,21 +523,16 @@ func importErrors() *lua.LTable { func importTime() *lua.LTable { pkg := L.NewTable() - L.SetField(pkg, "After", luar.New(L, time.After)) L.SetField(pkg, "Sleep", luar.New(L, time.Sleep)) - L.SetField(pkg, "Tick", luar.New(L, time.Tick)) L.SetField(pkg, "Since", luar.New(L, time.Since)) L.SetField(pkg, "FixedZone", luar.New(L, time.FixedZone)) L.SetField(pkg, "LoadLocation", luar.New(L, time.LoadLocation)) - L.SetField(pkg, "NewTicker", luar.New(L, time.NewTicker)) L.SetField(pkg, "Date", luar.New(L, time.Date)) L.SetField(pkg, "Now", luar.New(L, time.Now)) L.SetField(pkg, "Parse", luar.New(L, time.Parse)) L.SetField(pkg, "ParseDuration", luar.New(L, time.ParseDuration)) L.SetField(pkg, "ParseInLocation", luar.New(L, time.ParseInLocation)) L.SetField(pkg, "Unix", luar.New(L, time.Unix)) - L.SetField(pkg, "AfterFunc", luar.New(L, time.AfterFunc)) - L.SetField(pkg, "NewTimer", luar.New(L, time.NewTimer)) L.SetField(pkg, "Nanosecond", luar.New(L, time.Nanosecond)) L.SetField(pkg, "Microsecond", luar.New(L, time.Microsecond)) L.SetField(pkg, "Millisecond", luar.New(L, time.Millisecond))