]> Cypherpunks.ru repositories - gostls13.git/commitdiff
misc/wasm: update deprecated substr usage
authorMarko Kungla <marko.kungla@gmail.com>
Thu, 12 May 2022 22:34:02 +0000 (01:34 +0300)
committerGopher Robot <gobot@golang.org>
Tue, 27 Sep 2022 17:15:12 +0000 (17:15 +0000)
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>
misc/wasm/wasm_exec.js

index 9ce6a20c3ffa82debd6853a72f02c316ccfb642d..e6c8921091ec1253e5de679bb5ba75187936e0ee 100644 (file)
@@ -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;
                        },