mirror of
https://github.com/golang/go
synced 2025-05-01 02:44:01 +00:00
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 <gobot@golang.org> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
This commit is contained in:
committed by
Gopher Robot
parent
6c3567873c
commit
ff34676cdd
@ -19,8 +19,8 @@
|
|||||||
outputBuf += decoder.decode(buf);
|
outputBuf += decoder.decode(buf);
|
||||||
const nl = outputBuf.lastIndexOf("\n");
|
const nl = outputBuf.lastIndexOf("\n");
|
||||||
if (nl != -1) {
|
if (nl != -1) {
|
||||||
console.log(outputBuf.substr(0, nl));
|
console.log(outputBuf.substring(0, nl));
|
||||||
outputBuf = outputBuf.substr(nl + 1);
|
outputBuf = outputBuf.substring(nl + 1);
|
||||||
}
|
}
|
||||||
return buf.length;
|
return buf.length;
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user