From b3864e8ecd00aa15cb465fae1b5a77044317caf5 Mon Sep 17 00:00:00 2001 From: 3136352472 <3136352472> Date: Fri, 5 Jun 2020 09:52:16 +0800 Subject: [PATCH] fix --- jsruntime/timeout.go | 5 ++--- static/use.js | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/jsruntime/timeout.go b/jsruntime/timeout.go index 6bb0241..60423a8 100644 --- a/jsruntime/timeout.go +++ b/jsruntime/timeout.go @@ -3,7 +3,6 @@ package jsruntime import ( "github.com/dop251/goja" "log" - "time" ) func (jr *JsRuntime) EnableTimeoutFunc() { @@ -11,13 +10,13 @@ func (jr *JsRuntime) EnableTimeoutFunc() { jr.runtime.Set("setTimeout", func(call goja.FunctionCall) goja.Value { if fn, ok := goja.AssertFunction(call.Argument(0)); ok { - delay := call.Argument(1).ToInteger() + //delay := call.Argument(1).ToInteger() var args []goja.Value if len(call.Arguments) > 2 { args = call.Arguments[2:] } // - time.Sleep(time.Duration(delay) * time.Millisecond) + //time.Sleep(time.Duration(delay) * time.Millisecond) fn(nil, args...) } diff --git a/static/use.js b/static/use.js index 0a1e071..cb52304 100644 --- a/static/use.js +++ b/static/use.js @@ -25,6 +25,5 @@ GoUseRegistered("index", function (query) { "a": "官方ssr模式", "descs":["123","456"] }, - }); }); \ No newline at end of file