From: Marko Kungla Date: Thu, 12 May 2022 22:34:02 +0000 (+0300) Subject: misc/wasm: update deprecated substr usage X-Git-Tag: go1.20rc1~903 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ff34676cdd5f2c318fa58e78c84a90b3e5a21b04;p=gostls13.git misc/wasm: update deprecated substr usage String.prototype.substr is deprecated and usage is no longer recommended so using String.prototype.substring instead. Change-Id: I9eb49a8c065890df73301e3a04af59f550bc3ae1 Reviewed-on: https://go-review.googlesource.com/c/go/+/406094 TryBot-Result: Gopher Robot Auto-Submit: Dmitri Shuralyov Run-TryBot: Dmitri Shuralyov Reviewed-by: Cherry Mui Reviewed-by: Dmitri Shuralyov --- diff --git a/misc/wasm/wasm_exec.js b/misc/wasm/wasm_exec.js index 9ce6a20c3f..e6c8921091 100644 --- a/misc/wasm/wasm_exec.js +++ b/misc/wasm/wasm_exec.js @@ -19,8 +19,8 @@ outputBuf += decoder.decode(buf); const nl = outputBuf.lastIndexOf("\n"); if (nl != -1) { - console.log(outputBuf.substr(0, nl)); - outputBuf = outputBuf.substr(nl + 1); + console.log(outputBuf.substring(0, nl)); + outputBuf = outputBuf.substring(nl + 1); } return buf.length; },