From ff34676cdd5f2c318fa58e78c84a90b3e5a21b04 Mon Sep 17 00:00:00 2001 From: Marko Kungla Date: Fri, 13 May 2022 01:34:02 +0300 Subject: [PATCH] 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 --- misc/wasm/wasm_exec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; }, -- 2.50.0