Merge pull request from saromanov/fix-deprecated-values

os: use SeekStart, SeekCurrent and SeekEnd instead deprecated values
This commit is contained in:
Daniel Kang 2019-01-21 07:18:01 -08:00 committed by GitHub
commit a32ef0a3c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,7 @@
package stdlib
import (
"io"
"os"
"github.com/d5/tengo/objects"
@ -32,9 +33,9 @@ var osModule = map[string]objects.Object{
"path_separator": &objects.Char{Value: os.PathSeparator},
"path_list_separator": &objects.Char{Value: os.PathListSeparator},
"dev_null": &objects.String{Value: os.DevNull},
"seek_set": &objects.Int{Value: int64(os.SEEK_SET)},
"seek_cur": &objects.Int{Value: int64(os.SEEK_CUR)},
"seek_end": &objects.Int{Value: int64(os.SEEK_END)},
"seek_set": &objects.Int{Value: int64(io.SeekStart)},
"seek_cur": &objects.Int{Value: int64(io.SeekCurrent)},
"seek_end": &objects.Int{Value: int64(io.SeekEnd)},
// args() => array(string)
"args": &objects.UserFunction{Value: osArgs},
// chdir(dir string) => error