File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 1
1
module github.com/yuin/gopher-lua
2
2
3
+ go 1.14
4
+
3
5
require (
4
6
github.com/chzyer/logex v1.1.10 // indirect
5
7
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e
Original file line number Diff line number Diff line change @@ -1367,6 +1367,10 @@ func NewState(opts ...Options) *LState {
1367
1367
return ls
1368
1368
}
1369
1369
1370
+ func (ls * LState ) IsClosed () bool {
1371
+ return ls .stack == nil
1372
+ }
1373
+
1370
1374
func (ls * LState ) Close () {
1371
1375
atomic .AddInt32 (& ls .stop , 1 )
1372
1376
for _ , file := range ls .G .tempFiles {
Original file line number Diff line number Diff line change @@ -7,6 +7,12 @@ import (
7
7
"time"
8
8
)
9
9
10
+ func TestLStateIsClosed (t * testing.T ) {
11
+ L := NewState ()
12
+ L .Close ()
13
+ errorIfNotEqual (t , true , L .IsClosed ())
14
+ }
15
+
10
16
func TestCallStackOverflowWhenFixed (t * testing.T ) {
11
17
L := NewState (Options {
12
18
CallStackSize : 3 ,
You can’t perform that action at this time.
0 commit comments