Browse Source

in progress

000x000 2 years ago
parent
commit
c93c27cfca
2 changed files with 6 additions and 0 deletions
  1. 2 0
      content/main
  2. 4 0
      mjs.go

+ 2 - 0
content/main

@@ -9,6 +9,8 @@ include("inc", {
 
 sleep(2000)
 
+log('ooo')
+
 //flush(initError('aaaaa'))
 
 //flush(one)

+ 4 - 0
mjs.go

@@ -128,6 +128,10 @@ func (s *Mjs) Exec(name string, data map[string]interface{}) (modified int64, er
 		return nil
 	}
 
+	vm.Set("log", func(vals ...interface{}) {
+		log.Println(vals...)
+	})
+
 	vm.Set("define", func(vals ...interface{}) {
 		fCall, tmp := goja.FunctionCall{}, currentMod
 		parentMod = tmp