summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/d5/tengo/compiler/compiler_module.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/d5/tengo/compiler/compiler_module.go')
-rw-r--r--vendor/github.com/d5/tengo/compiler/compiler_module.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/vendor/github.com/d5/tengo/compiler/compiler_module.go b/vendor/github.com/d5/tengo/compiler/compiler_module.go
index 8f63abb3..d069bfab 100644
--- a/vendor/github.com/d5/tengo/compiler/compiler_module.go
+++ b/vendor/github.com/d5/tengo/compiler/compiler_module.go
@@ -77,11 +77,8 @@ func (c *Compiler) doCompileModule(moduleName string, src []byte) (*objects.Comp
symbolTable := NewSymbolTable()
// inherit builtin functions
- for idx, fn := range objects.Builtins {
- s, _, ok := c.symbolTable.Resolve(fn.Name)
- if ok && s.Scope == ScopeBuiltin {
- symbolTable.DefineBuiltin(idx, fn.Name)
- }
+ for _, sym := range c.symbolTable.BuiltinSymbols() {
+ symbolTable.DefineBuiltin(sym.Index, sym.Name)
}
// no global scope for the module