aboutsummaryrefslogtreecommitdiffstats
path: root/jsre/jsre_test.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-05-27 08:07:03 +0800
committerobscuren <geffobscura@gmail.com>2015-05-27 08:07:03 +0800
commit70867904a0255bd044851585a9ad2dc34391ced2 (patch)
tree9c5dfc6a9b8944c37f874a81cc9f8fd3d697ad4e /jsre/jsre_test.go
parentceea1a7051ddc7d2660117204aeb3392b7cf8314 (diff)
parent2c532a7255919bc09e01cca6866bfc15682509a3 (diff)
downloaddexon-70867904a0255bd044851585a9ad2dc34391ced2.tar
dexon-70867904a0255bd044851585a9ad2dc34391ced2.tar.gz
dexon-70867904a0255bd044851585a9ad2dc34391ced2.tar.bz2
dexon-70867904a0255bd044851585a9ad2dc34391ced2.tar.lz
dexon-70867904a0255bd044851585a9ad2dc34391ced2.tar.xz
dexon-70867904a0255bd044851585a9ad2dc34391ced2.tar.zst
dexon-70867904a0255bd044851585a9ad2dc34391ced2.zip
Merge branch 'release/0.9.25'
Diffstat (limited to 'jsre/jsre_test.go')
-rw-r--r--jsre/jsre_test.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/jsre/jsre_test.go b/jsre/jsre_test.go
index 5eaca2b91..42308de88 100644
--- a/jsre/jsre_test.go
+++ b/jsre/jsre_test.go
@@ -1,16 +1,15 @@
package jsre
import (
- "github.com/robertkrimen/otto"
"io/ioutil"
"os"
"testing"
"time"
+
+ "github.com/robertkrimen/otto"
)
-type testNativeObjectBinding struct {
- toVal func(interface{}) otto.Value
-}
+type testNativeObjectBinding struct{}
type msg struct {
Msg string
@@ -21,7 +20,8 @@ func (no *testNativeObjectBinding) TestMethod(call otto.FunctionCall) otto.Value
if err != nil {
return otto.UndefinedValue()
}
- return no.toVal(&msg{m})
+ v, _ := call.Otto.ToValue(&msg{m})
+ return v
}
func TestExec(t *testing.T) {
@@ -74,7 +74,7 @@ func TestNatto(t *testing.T) {
func TestBind(t *testing.T) {
jsre := New("/tmp")
- jsre.Bind("no", &testNativeObjectBinding{jsre.ToVal})
+ jsre.Bind("no", &testNativeObjectBinding{})
val, err := jsre.Run(`no.TestMethod("testMsg")`)
if err != nil {