[go] misc/wasm: add polyfill for TextEncoder/TextDecoder for Edge support

345 views
Skip to first unread message

Gerrit Bot (Gerrit)

unread,
Aug 28, 2018, 3:28:09 AM8/28/18
to Ian Lance Taylor, goph...@pubsubhelper.golang.org, Jake Bentvelzen, golang-co...@googlegroups.com

Gerrit Bot has uploaded this change for review.

View Change

misc/wasm: add polyfill for TextEncoder/TextDecoder for Edge support

Edge supports WASM but not TextEncoder or TextDecoder.
This PR adds a polyfill to `misc/wasm/wasm_exec.js` to fix this.

Fixes #27295

Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
GitHub-Last-Rev: 08f86548d99d3ae10ae6c08645059c2cfcc3a798
GitHub-Pull-Request: golang/go#27296
---
M misc/wasm/wasm_exec.js
1 file changed, 76 insertions(+), 0 deletions(-)

diff --git a/misc/wasm/wasm_exec.js b/misc/wasm/wasm_exec.js
index 94b9552..6fde8036 100644
--- a/misc/wasm/wasm_exec.js
+++ b/misc/wasm/wasm_exec.js
@@ -27,6 +27,82 @@
global.TextEncoder = util.TextEncoder;
global.TextDecoder = util.TextDecoder;
} else {
+ // Add polyfill for TextEncoder and TextDecoder for Microsoft Edge 17/18 support
+ // https://caniuse.com/#feat=textencoder
+ if (!window.TextEncoder) {
+ TextEncoder = function(){}
+ TextEncoder.prototype.encode = function (string) {
+ var octets = [];
+ var length = string.length;
+ var i = 0;
+ while (i < length) {
+ var codePoint = string.codePointAt(i);
+ var c = 0;
+ var bits = 0;
+ if (codePoint <= 0x0000007F) {
+ c = 0;
+ bits = 0x00;
+ } else if (codePoint <= 0x000007FF) {
+ c = 6;
+ bits = 0xC0;
+ } else if (codePoint <= 0x0000FFFF) {
+ c = 12;
+ bits = 0xE0;
+ } else if (codePoint <= 0x001FFFFF) {
+ c = 18;
+ bits = 0xF0;
+ }
+ octets.push(bits | (codePoint >> c));
+ c -= 6;
+ while (c >= 0) {
+ octets.push(0x80 | ((codePoint >> c) & 0x3F));
+ c -= 6;
+ }
+ i += codePoint >= 0x10000 ? 2 : 1;
+ }
+ return octets;
+ };
+ }
+ if (!window.TextDecoder) {
+ TextDecoder = function(){}
+ TextDecoder.prototype.decode = function (octets) {
+ var string = "";
+ var i = 0;
+ while (i < octets.length) {
+ var octet = octets[i];
+ var bytesNeeded = 0;
+ var codePoint = 0;
+ if (octet <= 0x7F) {
+ bytesNeeded = 0;
+ codePoint = octet & 0xFF;
+ } else if (octet <= 0xDF) {
+ bytesNeeded = 1;
+ codePoint = octet & 0x1F;
+ } else if (octet <= 0xEF) {
+ bytesNeeded = 2;
+ codePoint = octet & 0x0F;
+ } else if (octet <= 0xF4) {
+ bytesNeeded = 3;
+ codePoint = octet & 0x07;
+ }
+ if (octets.length - i - bytesNeeded > 0) {
+ var k = 0;
+ while (k < bytesNeeded) {
+ octet = octets[i + k + 1];
+ codePoint = (codePoint << 6) | (octet & 0x3F);
+ k += 1;
+ }
+ } else {
+ codePoint = 0xFFFD;
+ bytesNeeded = octets.length - i;
+ }
+ string += String.fromCodePoint(codePoint);
+ i += bytesNeeded + 1;
+ }
+ return string
+ };
+ }
+
if (typeof window !== "undefined") {
window.global = window;
} else if (typeof self !== "undefined") {

To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
Gerrit-Change-Number: 131718
Gerrit-PatchSet: 1
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
Gerrit-MessageType: newchange

Gobot Gobot (Gerrit)

unread,
Aug 28, 2018, 3:28:19 AM8/28/18
to Jake Bentvelzen, Gerrit Bot, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Congratulations on opening your first change. Thank you for your contribution!

Next steps:
Within the next week or so, a maintainer will review your change and provide
feedback. See https://golang.org/doc/contribute.html#review for more info and
tips to get your patch through code review.

Most changes in the Go project go through a few rounds of revision. This can be
surprising to people new to the project. The careful, iterative review process
is our way of helping mentor contributors and ensuring that their contributions
have a lasting impact.

During May-July and Nov-Jan the Go project is in a code freeze, during which
little code gets reviewed or merged. If a reviewer responds with a comment like
R=go1.11, it means that this CL will be reviewed as part of the next development
cycle. See https://golang.org/s/release for more details.

View Change

    To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
    Gerrit-Change-Number: 131718
    Gerrit-PatchSet: 1
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
    Gerrit-CC: Gobot Gobot <go...@golang.org>
    Gerrit-Comment-Date: Tue, 28 Aug 2018 07:28:16 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Richard Musiol (Gerrit)

    unread,
    Aug 28, 2018, 4:46:52 AM8/28/18
    to Jake Bentvelzen, Gerrit Bot, goph...@pubsubhelper.golang.org, Brad Fitzpatrick, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

    Polyfills should be provided by the user. Please move this to the other polyfill in wasm_exec.html.

    Who is the author of this polyfill? Are we allowed to use it? Do we need to add attribution?

    View Change

      To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
      Gerrit-Change-Number: 131718
      Gerrit-PatchSet: 1
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
      Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
      Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
      Gerrit-CC: Agniva De Sarker <agniva.qu...@gmail.com>
      Gerrit-CC: Gobot Gobot <go...@golang.org>
      Gerrit-Comment-Date: Tue, 28 Aug 2018 08:46:49 +0000

      Jake Bentvelzen (Gerrit)

      unread,
      Aug 29, 2018, 9:02:39 AM8/29/18
      to Gerrit Bot, goph...@pubsubhelper.golang.org, Richard Musiol, Brad Fitzpatrick, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

      Patch Set 1:

      Polyfills should be provided by the user. Please move this to the other polyfill in wasm_exec.html.

      Who is the author of this polyfill? Are we allowed to use it? Do we need to add attribution?

      The author is the GitHub user Yaffle, and it was taken from their gists here:
      https://gist.github.com/Yaffle/5458286

      Since it doesn't seem to have a license attached, I'll assume we cannot use it.

      I tested the following polyfill and that seems to work fine as well, it's also licensed under "Apache License 2.0" which seems like it should be OK? (Though I'm not sure when it comes to licensing)
      https://github.com/samthor/fast-text-encoding/

      I also had a look for other implementations on GitHub and looked at their licensing, but it seemed to either use "Apache License 2.0", "Creative Commons Attribution 4.0 International License" or be unclear. ie.

      If this is a problem, is it OK if I rewrite the implementation so that it doesn't resemble these?
      Alternatively, I could just change this PR to simply be a code comment that tells the user that if they want Edge support, they will need a polyfill for TextEncoder/TextDecoder.

      Thoughts?

      View Change

        To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
        Gerrit-Change-Number: 131718
        Gerrit-PatchSet: 1
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
        Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
        Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
        Gerrit-CC: Agniva De Sarker <agniva.qu...@gmail.com>
        Gerrit-CC: Gobot Gobot <go...@golang.org>
        Gerrit-Comment-Date: Wed, 29 Aug 2018 09:26:05 +0000

        Agniva De Sarker (Gerrit)

        unread,
        Aug 31, 2018, 6:15:11 AM8/31/18
        to Jake Bentvelzen, Gerrit Bot, goph...@pubsubhelper.golang.org, Richard Musiol, Brad Fitzpatrick, Gobot Gobot, golang-co...@googlegroups.com

        Patch Set 1:

        Patch Set 1:

        Polyfills should be provided by the user. Please move this to the other polyfill in wasm_exec.html.

        Who is the author of this polyfill? Are we allowed to use it? Do we need to add attribution?

        The author is the GitHub user Yaffle, and it was taken from their gists here:
        https://gist.github.com/Yaffle/5458286

        Since it doesn't seem to have a license attached, I'll assume we cannot use it.

        I tested the following polyfill and that seems to work fine as well, it's also licensed under "Apache License 2.0" which seems like it should be OK? (Though I'm not sure when it comes to licensing)
        https://github.com/samthor/fast-text-encoding/

        I also had a look for other implementations on GitHub and looked at their licensing, but it seemed to either use "Apache License 2.0", "Creative Commons Attribution 4.0 International License" or be unclear. ie.

        If this is a problem, is it OK if I rewrite the implementation so that it doesn't resemble these?
        Alternatively, I could just change this PR to simply be a code comment that tells the user that if they want Edge support, they will need a polyfill for TextEncoder/TextDecoder.

        Thoughts?


        I have commented on Yaffle's gist to add a license.

        Apache License 2.0 is fine too, as long as we keep the license notice. I think we have an open issue somewhere to aggregate all the licences used in the code in a single big license file.

        View Change

          To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

          Gerrit-Project: go
          Gerrit-Branch: master
          Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
          Gerrit-Change-Number: 131718
          Gerrit-PatchSet: 1
          Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
          Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
          Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
          Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
          Gerrit-CC: Agniva De Sarker <agniva.qu...@gmail.com>
          Gerrit-CC: Gobot Gobot <go...@golang.org>
          Gerrit-Comment-Date: Fri, 31 Aug 2018 10:15:08 +0000

          Gerrit Bot (Gerrit)

          unread,
          Sep 1, 2018, 2:24:16 AM9/1/18
          to Jake Bentvelzen, Richard Musiol, Brad Fitzpatrick, goph...@pubsubhelper.golang.org, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

          Gerrit Bot uploaded patch set #2 to this change.

          View Change

          misc/wasm: add polyfill for TextEncoder/TextDecoder for Edge support

          Edge supports WASM but not TextEncoder or TextDecoder.
          This PR adds a polyfill to `misc/wasm/wasm_exec.js` to fix this.

          Fixes #27295

          Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
          GitHub-Last-Rev: 144a054c28be25b40c180d2fc8cf3aa47fb75217
          GitHub-Pull-Request: golang/go#27296
          ---
          M misc/wasm/wasm_exec.html

          1 file changed, 76 insertions(+), 0 deletions(-)

          To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

          Gerrit-Project: go
          Gerrit-Branch: master
          Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
          Gerrit-Change-Number: 131718
          Gerrit-PatchSet: 2
          Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
          Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
          Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
          Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
          Gerrit-CC: Agniva De Sarker <agniva.qu...@gmail.com>
          Gerrit-CC: Gobot Gobot <go...@golang.org>
          Gerrit-MessageType: newpatchset

          Gerrit Bot (Gerrit)

          unread,
          Sep 1, 2018, 2:24:38 AM9/1/18
          to Jake Bentvelzen, Richard Musiol, Brad Fitzpatrick, goph...@pubsubhelper.golang.org, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

          Gerrit Bot uploaded patch set #3 to this change.

          View Change

          misc/wasm: add polyfill for TextEncoder/TextDecoder for Edge support

          Edge supports WASM but not TextEncoder or TextDecoder.
          This PR adds a polyfill to `misc/wasm/wasm_exec.js` to fix this.

          Fixes #27295

          Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
          GitHub-Last-Rev: 144a054c28be25b40c180d2fc8cf3aa47fb75217
          GitHub-Pull-Request: golang/go#27296
          ---
          M misc/wasm/wasm_exec.html
          1 file changed, 76 insertions(+), 0 deletions(-)

          To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

          Gerrit-Project: go
          Gerrit-Branch: master
          Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
          Gerrit-Change-Number: 131718
          Gerrit-PatchSet: 3
          Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>

          Jake Bentvelzen (Gerrit)

          unread,
          Sep 1, 2018, 2:27:06 AM9/1/18
          to Gerrit Bot, goph...@pubsubhelper.golang.org, Richard Musiol, Brad Fitzpatrick, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

          Patch Set 1:

          Patch Set 1:

          Patch Set 1:

          Polyfills should be provided by the user. Please move this to the other polyfill in wasm_exec.html.

          Who is the author of this polyfill? Are we allowed to use it? Do we need to add attribution?

          The author is the GitHub user Yaffle, and it was taken from their gists here:
          https://gist.github.com/Yaffle/5458286

          Since it doesn't seem to have a license attached, I'll assume we cannot use it.

          I tested the following polyfill and that seems to work fine as well, it's also licensed under "Apache License 2.0" which seems like it should be OK? (Though I'm not sure when it comes to licensing)
          https://github.com/samthor/fast-text-encoding/

          I also had a look for other implementations on GitHub and looked at their licensing, but it seemed to either use "Apache License 2.0", "Creative Commons Attribution 4.0 International License" or be unclear. ie.

          If this is a problem, is it OK if I rewrite the implementation so that it doesn't resemble these?
          Alternatively, I could just change this PR to simply be a code comment that tells the user that if they want Edge support, they will need a polyfill for TextEncoder/TextDecoder.

          Thoughts?


          I have commented on Yaffle's gist to add a license.

          Apache License 2.0 is fine too, as long as we keep the license notice. I think we have an open issue somewhere to aggregate all the licences used in the code in a single big license file.

          Alright thanks!
          I've updated the PR so that the polyfill is in wasm_exec.html.

          Assuming Yaffle adds a license or gives the OK, is there any other changes you'd like me to make?
          Do I need to squash my commits / rebase as well?

          View Change

            To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

            Gerrit-Project: go
            Gerrit-Branch: master
            Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
            Gerrit-Change-Number: 131718
            Gerrit-PatchSet: 3
            Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
            Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
            Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
            Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
            Gerrit-CC: Agniva De Sarker <agniva.qu...@gmail.com>
            Gerrit-CC: Gobot Gobot <go...@golang.org>
            Gerrit-Comment-Date: Sat, 01 Sep 2018 06:26:58 +0000

            Richard Musiol (Gerrit)

            unread,
            Sep 1, 2018, 9:47:17 AM9/1/18
            to Jake Bentvelzen, Gerrit Bot, goph...@pubsubhelper.golang.org, Brad Fitzpatrick, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

            View Change

            4 comments:

            To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

            Gerrit-Project: go
            Gerrit-Branch: master
            Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
            Gerrit-Change-Number: 131718
            Gerrit-PatchSet: 3
            Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
            Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
            Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
            Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
            Gerrit-CC: Agniva De Sarker <agniva.qu...@gmail.com>
            Gerrit-CC: Gobot Gobot <go...@golang.org>
            Gerrit-Comment-Date: Sat, 01 Sep 2018 13:47:13 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Gerrit-MessageType: comment

            Gerrit Bot (Gerrit)

            unread,
            Sep 2, 2018, 12:18:12 AM9/2/18
            to Jake Bentvelzen, Richard Musiol, Brad Fitzpatrick, goph...@pubsubhelper.golang.org, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

            Gerrit Bot uploaded patch set #4 to this change.

            View Change

            misc/wasm: add polyfill for TextEncoder/TextDecoder for Edge support

            Edge supports WASM but not TextEncoder or TextDecoder.
            This PR adds a polyfill to `misc/wasm/wasm_exec.js` to fix this.

            Fixes #27295

            Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
            GitHub-Last-Rev: 6508d1a0c76d11fbab4cac3259701a4b3dcf3c96

            GitHub-Pull-Request: golang/go#27296
            ---
            M misc/wasm/wasm_exec.html
            1 file changed, 77 insertions(+), 0 deletions(-)

            To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

            Gerrit-Project: go
            Gerrit-Branch: master
            Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
            Gerrit-Change-Number: 131718
            Gerrit-PatchSet: 4
            Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
            Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
            Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
            Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
            Gerrit-CC: Agniva De Sarker <agniva.qu...@gmail.com>
            Gerrit-CC: Gobot Gobot <go...@golang.org>
            Gerrit-MessageType: newpatchset

            Gerrit Bot (Gerrit)

            unread,
            Sep 2, 2018, 12:18:34 AM9/2/18
            to Jake Bentvelzen, Richard Musiol, Brad Fitzpatrick, goph...@pubsubhelper.golang.org, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

            Gerrit Bot uploaded patch set #5 to this change.

            View Change

            misc/wasm: add polyfill for TextEncoder/TextDecoder for Edge support

            Edge supports WASM but not TextEncoder or TextDecoder.
            This PR adds a polyfill to `misc/wasm/wasm_exec.js` to fix this.

            Fixes #27295

            Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
            GitHub-Last-Rev: 6508d1a0c76d11fbab4cac3259701a4b3dcf3c96
            GitHub-Pull-Request: golang/go#27296
            ---
            M misc/wasm/wasm_exec.html
            1 file changed, 77 insertions(+), 0 deletions(-)

            To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

            Gerrit-Project: go
            Gerrit-Branch: master
            Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
            Gerrit-Change-Number: 131718
            Gerrit-PatchSet: 5
            Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>

            Jake Bentvelzen (Gerrit)

            unread,
            Sep 2, 2018, 12:22:01 AM9/2/18
            to Gerrit Bot, goph...@pubsubhelper.golang.org, Richard Musiol, Brad Fitzpatrick, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

            Patch Set 3:

            (4 comments)

            I've made the changes requested.
            I've also moved the polyfill to execute before "wasm_exec.js" because `TextEncoder` and `TextDecoder` are referenced immediately when the script is included, causing a crash in Edge.

            Perhaps the encoder/decoder const variables in wasm_exec.js should be instantiated in the Go class constructor or similar? (So the polyfill can be included after the script but before initialization of `new Go()`)

            View Change

              To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

              Gerrit-Project: go
              Gerrit-Branch: master
              Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
              Gerrit-Change-Number: 131718
              Gerrit-PatchSet: 3
              Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
              Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
              Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
              Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
              Gerrit-CC: Agniva De Sarker <agniva.qu...@gmail.com>
              Gerrit-CC: Gobot Gobot <go...@golang.org>
              Gerrit-Comment-Date: Sun, 02 Sep 2018 04:21:57 +0000

              Gerrit Bot (Gerrit)

              unread,
              Sep 2, 2018, 12:25:04 AM9/2/18
              to Jake Bentvelzen, Richard Musiol, Brad Fitzpatrick, goph...@pubsubhelper.golang.org, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

              Gerrit Bot uploaded patch set #6 to this change.

              View Change

              misc/wasm: add polyfill for TextEncoder/TextDecoder for Edge support

              Edge supports WASM but not TextEncoder or TextDecoder.
              This PR adds a polyfill to `misc/wasm/wasm_exec.js` to fix this.

              Fixes #27295

              Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
              GitHub-Last-Rev: da7f55aa1ff452579c41ed00052d3ce9917f09eb

              GitHub-Pull-Request: golang/go#27296
              ---
              M misc/wasm/wasm_exec.html
              1 file changed, 77 insertions(+), 0 deletions(-)

              To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

              Gerrit-Project: go
              Gerrit-Branch: master
              Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
              Gerrit-Change-Number: 131718
              Gerrit-PatchSet: 6
              Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
              Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
              Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
              Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
              Gerrit-CC: Agniva De Sarker <agniva.qu...@gmail.com>
              Gerrit-CC: Gobot Gobot <go...@golang.org>
              Gerrit-MessageType: newpatchset

              Gerrit Bot (Gerrit)

              unread,
              Sep 2, 2018, 12:25:25 AM9/2/18
              to Jake Bentvelzen, Richard Musiol, Brad Fitzpatrick, goph...@pubsubhelper.golang.org, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

              Gerrit Bot uploaded patch set #7 to this change.

              View Change

              misc/wasm: add polyfill for TextEncoder/TextDecoder for Edge support

              Edge supports WASM but not TextEncoder or TextDecoder.
              This PR adds a polyfill to `misc/wasm/wasm_exec.js` to fix this.

              Fixes #27295

              Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
              GitHub-Last-Rev: da7f55aa1ff452579c41ed00052d3ce9917f09eb
              GitHub-Pull-Request: golang/go#27296
              ---
              M misc/wasm/wasm_exec.html
              1 file changed, 77 insertions(+), 0 deletions(-)

              To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

              Gerrit-Project: go
              Gerrit-Branch: master
              Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
              Gerrit-Change-Number: 131718
              Gerrit-PatchSet: 7
              Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>

              Gerrit Bot (Gerrit)

              unread,
              Sep 2, 2018, 12:30:07 AM9/2/18
              to Jake Bentvelzen, Richard Musiol, Brad Fitzpatrick, goph...@pubsubhelper.golang.org, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

              Gerrit Bot uploaded patch set #8 to this change.

              View Change

              misc/wasm: add polyfill for TextEncoder/TextDecoder for Edge support

              Edge supports WASM but not TextEncoder or TextDecoder.
              This PR adds a polyfill to `misc/wasm/wasm_exec.js` to fix this.

              Fixes #27295

              Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
              GitHub-Last-Rev: 75c2b517e68a92133b53ae8c827f525566d6e34c

              GitHub-Pull-Request: golang/go#27296
              ---
              M misc/wasm/wasm_exec.html
              1 file changed, 77 insertions(+), 0 deletions(-)

              To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

              Gerrit-Project: go
              Gerrit-Branch: master
              Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
              Gerrit-Change-Number: 131718
              Gerrit-PatchSet: 8
              Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>

              Gerrit Bot (Gerrit)

              unread,
              Sep 2, 2018, 12:30:29 AM9/2/18
              to Jake Bentvelzen, Richard Musiol, Brad Fitzpatrick, goph...@pubsubhelper.golang.org, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

              Gerrit Bot uploaded patch set #9 to this change.

              View Change

              misc/wasm: add polyfill for TextEncoder/TextDecoder for Edge support

              Edge supports WASM but not TextEncoder or TextDecoder.
              This PR adds a polyfill to `misc/wasm/wasm_exec.js` to fix this.

              Fixes #27295

              Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
              GitHub-Last-Rev: 75c2b517e68a92133b53ae8c827f525566d6e34c
              GitHub-Pull-Request: golang/go#27296
              ---
              M misc/wasm/wasm_exec.html
              1 file changed, 77 insertions(+), 0 deletions(-)

              To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

              Gerrit-Project: go
              Gerrit-Branch: master
              Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
              Gerrit-Change-Number: 131718
              Gerrit-PatchSet: 9
              Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>

              Gerrit Bot (Gerrit)

              unread,
              Sep 2, 2018, 12:32:38 AM9/2/18
              to Jake Bentvelzen, Richard Musiol, Brad Fitzpatrick, goph...@pubsubhelper.golang.org, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

              Gerrit Bot uploaded patch set #10 to this change.

              View Change

              misc/wasm: add polyfill for TextEncoder/TextDecoder for Edge support

              Edge supports WASM but not TextEncoder or TextDecoder.
              This PR adds a polyfill to `misc/wasm/wasm_exec.js` to fix this.

              Fixes #27295

              Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
              GitHub-Last-Rev: 381b5413619434b819df753f01cefd2222a91af8

              GitHub-Pull-Request: golang/go#27296
              ---
              M misc/wasm/wasm_exec.html
              1 file changed, 77 insertions(+), 0 deletions(-)

              To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

              Gerrit-Project: go
              Gerrit-Branch: master
              Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
              Gerrit-Change-Number: 131718
              Gerrit-PatchSet: 10
              Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>

              Gerrit Bot (Gerrit)

              unread,
              Sep 2, 2018, 12:32:59 AM9/2/18
              to Jake Bentvelzen, Richard Musiol, Brad Fitzpatrick, goph...@pubsubhelper.golang.org, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

              Gerrit Bot uploaded patch set #11 to this change.

              View Change

              misc/wasm: add polyfill for TextEncoder/TextDecoder for Edge support

              Edge supports WASM but not TextEncoder or TextDecoder.
              This PR adds a polyfill to `misc/wasm/wasm_exec.js` to fix this.

              Fixes #27295

              Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
              GitHub-Last-Rev: 381b5413619434b819df753f01cefd2222a91af8
              GitHub-Pull-Request: golang/go#27296
              ---
              M misc/wasm/wasm_exec.html
              1 file changed, 77 insertions(+), 0 deletions(-)

              To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

              Gerrit-Project: go
              Gerrit-Branch: master
              Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
              Gerrit-Change-Number: 131718
              Gerrit-PatchSet: 11
              Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>

              Jake Bentvelzen (Gerrit)

              unread,
              Sep 2, 2018, 12:34:58 AM9/2/18
              to Gerrit Bot, goph...@pubsubhelper.golang.org, Richard Musiol, Brad Fitzpatrick, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

              Patch Set 3:

              Patch Set 3:

              (4 comments)

              I've made the changes requested.
              I've also moved the polyfill to execute before "wasm_exec.js" because `TextEncoder` and `TextDecoder` are referenced immediately when the script is included, causing a crash in Edge.

              Perhaps the encoder/decoder const variables in wasm_exec.js should be instantiated in the Go class constructor or similar? (So the polyfill can be included after the script but before initialization of `new Go()`)

              Commented too soon and missed a semicolon on the "window.TextDecoder = function(){};".
              Rebased on master and also fixed that!

              View Change

              4 comments:

                • Please use "const" and "let", to be consistent with the rest of the file.

              To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

              Gerrit-Project: go
              Gerrit-Branch: master
              Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
              Gerrit-Change-Number: 131718
              Gerrit-PatchSet: 11
              Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
              Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
              Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
              Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
              Gerrit-CC: Agniva De Sarker <agniva.qu...@gmail.com>
              Gerrit-CC: Gobot Gobot <go...@golang.org>
              Gerrit-Comment-Date: Sun, 02 Sep 2018 04:34:54 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              Comment-In-Reply-To: Richard Musiol <neel...@gmail.com>
              Gerrit-MessageType: comment

              Agniva De Sarker (Gerrit)

              unread,
              Sep 2, 2018, 1:02:17 AM9/2/18
              to Jake Bentvelzen, Gerrit Bot, goph...@pubsubhelper.golang.org, Richard Musiol, Brad Fitzpatrick, Gobot Gobot, golang-co...@googlegroups.com

              View Change

              1 comment:

              To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

              Gerrit-Project: go
              Gerrit-Branch: master
              Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
              Gerrit-Change-Number: 131718
              Gerrit-PatchSet: 11
              Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
              Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
              Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
              Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
              Gerrit-CC: Agniva De Sarker <agniva.qu...@gmail.com>
              Gerrit-CC: Gobot Gobot <go...@golang.org>
              Gerrit-Comment-Date: Sun, 02 Sep 2018 05:02:13 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              Gerrit-MessageType: comment

              Jake Bentvelzen (Gerrit)

              unread,
              Sep 2, 2018, 1:28:04 AM9/2/18
              to Gerrit Bot, goph...@pubsubhelper.golang.org, Richard Musiol, Brad Fitzpatrick, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

              Patch Set 11:

              (1 comment)

              Added comment to your feedback item

              View Change

              1 comment:

                • Patch Set #11, Line 20: TextEncoder.prototype.encode = function (string) {

                  Let us use the arrow syntax `() => {}` everywhere to be consistent.

                • We are not using `this` in the prototype functions so I'm not convinced using fat arrow syntax here is a good idea.

                  As per recommendations found in the link below, I think we should leave the prototype functions alone:
                  https://stackoverflow.com/a/23045200

              To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

              Gerrit-Project: go
              Gerrit-Branch: master
              Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
              Gerrit-Change-Number: 131718
              Gerrit-PatchSet: 11
              Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
              Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
              Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
              Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
              Gerrit-CC: Agniva De Sarker <agniva.qu...@gmail.com>
              Gerrit-CC: Gobot Gobot <go...@golang.org>
              Gerrit-Comment-Date: Sun, 02 Sep 2018 05:27:57 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              Comment-In-Reply-To: Agniva De Sarker <agniva.qu...@gmail.com>
              Gerrit-MessageType: comment

              Agniva De Sarker (Gerrit)

              unread,
              Sep 2, 2018, 1:52:03 AM9/2/18
              to Jake Bentvelzen, Gerrit Bot, goph...@pubsubhelper.golang.org, Richard Musiol, Brad Fitzpatrick, Gobot Gobot, golang-co...@googlegroups.com

              View Change

              1 comment:

                • We are not using `this` in the prototype functions so I'm not convinced using fat arrow syntax here […]

                  That's true actually. Makes sense to me.

              To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

              Gerrit-Project: go
              Gerrit-Branch: master
              Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
              Gerrit-Change-Number: 131718
              Gerrit-PatchSet: 11
              Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
              Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
              Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
              Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
              Gerrit-CC: Agniva De Sarker <agniva.qu...@gmail.com>
              Gerrit-CC: Gobot Gobot <go...@golang.org>
              Gerrit-Comment-Date: Sun, 02 Sep 2018 05:51:59 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              Comment-In-Reply-To: Agniva De Sarker <agniva.qu...@gmail.com>
              Comment-In-Reply-To: Jake Bentvelzen <doogi...@gmail.com>
              Gerrit-MessageType: comment

              Agniva De Sarker (Gerrit)

              unread,
              Sep 2, 2018, 5:44:10 AM9/2/18
              to Jake Bentvelzen, Gerrit Bot, goph...@pubsubhelper.golang.org, Richard Musiol, Brad Fitzpatrick, Gobot Gobot, golang-co...@googlegroups.com

              Sorry for commenting this late in the review.

              But I just saw a polyfill implementation of textencoder in the MDN site https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder#Polyfill. I think that is a better candidate to avoid licensing issues.

              Also, the MDN docs point to this repo - https://github.com/inexorabletash/text-encoding which has a public license and has both encoding and decoding functions.

              I know its a pain to change the algo at this stage of the review and I have no problems as such with the existing implementation. Up to Richard/Brad to take a final call.

              View Change

                To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

                Gerrit-Project: go
                Gerrit-Branch: master
                Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                Gerrit-Change-Number: 131718
                Gerrit-PatchSet: 11
                Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
                Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
                Gerrit-CC: Agniva De Sarker <agniva.qu...@gmail.com>
                Gerrit-CC: Gobot Gobot <go...@golang.org>
                Gerrit-Comment-Date: Sun, 02 Sep 2018 09:44:06 +0000

                Jake Bentvelzen (Gerrit)

                unread,
                Sep 7, 2018, 10:15:43 PM9/7/18
                to Gerrit Bot, goph...@pubsubhelper.golang.org, Richard Musiol, Brad Fitzpatrick, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

                Patch Set 11:

                Sorry for commenting this late in the review.

                But I just saw a polyfill implementation of textencoder in the MDN site https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder#Polyfill. I think that is a better candidate to avoid licensing issues.

                Also, the MDN docs point to this repo - https://github.com/inexorabletash/text-encoding which has a public license and has both encoding and decoding functions.

                I know its a pain to change the algo at this stage of the review and I have no problems as such with the existing implementation. Up to Richard/Brad to take a final call.

                I'm happy to do this, I just want confirmation first!

                View Change

                  To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

                  Gerrit-Project: go
                  Gerrit-Branch: master
                  Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                  Gerrit-Change-Number: 131718
                  Gerrit-PatchSet: 11
                  Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                  Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                  Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
                  Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
                  Gerrit-CC: Agniva De Sarker <agniva.qu...@gmail.com>
                  Gerrit-CC: Gobot Gobot <go...@golang.org>
                  Gerrit-Comment-Date: Sat, 08 Sep 2018 02:15:37 +0000

                  Richard Musiol (Gerrit)

                  unread,
                  Sep 22, 2018, 11:30:05 AM9/22/18
                  to Jake Bentvelzen, Gerrit Bot, goph...@pubsubhelper.golang.org, Brad Fitzpatrick, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

                  Patch Set 11:

                  Patch Set 11:

                  Sorry for commenting this late in the review.

                  But I just saw a polyfill implementation of textencoder in the MDN site https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder#Polyfill. I think that is a better candidate to avoid licensing issues.

                  Also, the MDN docs point to this repo - https://github.com/inexorabletash/text-encoding which has a public license and has both encoding and decoding functions.

                  I know its a pain to change the algo at this stage of the review and I have no problems as such with the existing implementation. Up to Richard/Brad to take a final call.

                  I'm happy to do this, I just want confirmation first!

                  Unfortunately the gist https://gist.github.com/Yaffle/5458286 still has no license at all.

                  The license of MDN code snippets is CC0, which is good, but there seems to be no polyfill for the decoder.

                  The project https://github.com/inexorabletash/text-encoding is in the public domain as well, but it is quite large. What about just referencing it:

                    <!-- Polyfill for TextEncoder and TextDecoder -->
                  <script src="https://unpkg.com/text-e...@0.6.4/lib/encoding.js"></script>

                  View Change

                    To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

                    Gerrit-Project: go
                    Gerrit-Branch: master
                    Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                    Gerrit-Change-Number: 131718
                    Gerrit-PatchSet: 11
                    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                    Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                    Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
                    Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
                    Gerrit-CC: Agniva De Sarker <agniva.qu...@gmail.com>
                    Gerrit-CC: Gobot Gobot <go...@golang.org>
                    Gerrit-Comment-Date: Sat, 22 Sep 2018 15:30:01 +0000

                    Agniva De Sarker (Gerrit)

                    unread,
                    Sep 28, 2018, 2:37:44 AM9/28/18
                    to Jake Bentvelzen, Gerrit Bot, goph...@pubsubhelper.golang.org, Richard Musiol, Brad Fitzpatrick, Gobot Gobot, golang-co...@googlegroups.com

                    Patch Set 11:

                    Patch Set 11:

                    Patch Set 11:

                    Sorry for commenting this late in the review.

                    But I just saw a polyfill implementation of textencoder in the MDN site https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder#Polyfill. I think that is a better candidate to avoid licensing issues.

                    Also, the MDN docs point to this repo - https://github.com/inexorabletash/text-encoding which has a public license and has both encoding and decoding functions.

                    I know its a pain to change the algo at this stage of the review and I have no problems as such with the existing implementation. Up to Richard/Brad to take a final call.

                    I'm happy to do this, I just want confirmation first!

                    Unfortunately the gist https://gist.github.com/Yaffle/5458286 still has no license at all.

                    The license of MDN code snippets is CC0, which is good, but there seems to be no polyfill for the decoder.

                    The project https://github.com/inexorabletash/text-encoding is in the public domain as well, but it is quite large. What about just referencing it:

                      <!-- Polyfill for TextEncoder and TextDecoder -->
                    <script src="https://unpkg.com/text-e...@0.6.4/lib/encoding.js"></script>

                    That works. But I wouldn't want to inject a large script unconditionally. Let's check for TextEncoder support and then inject it if it's not there.

                    Something like this - 
                    if (!window.TextEncoder || !window.TextDecoder) {
                    let s = document.createElement('script');
                    s.src = "https://unpkg.com/text-e...@0.6.4/lib/encoding.js"
                    document.body.appendChild(s)
                    }

                    View Change

                      To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

                      Gerrit-Project: go
                      Gerrit-Branch: master
                      Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                      Gerrit-Change-Number: 131718
                      Gerrit-PatchSet: 11
                      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                      Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                      Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
                      Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
                      Gerrit-CC: Agniva De Sarker <agniva.qu...@gmail.com>
                      Gerrit-CC: Gobot Gobot <go...@golang.org>
                      Gerrit-Comment-Date: Fri, 28 Sep 2018 06:37:38 +0000

                      Richard Musiol (Gerrit)

                      unread,
                      Sep 28, 2018, 3:55:36 AM9/28/18
                      to Jake Bentvelzen, Gerrit Bot, goph...@pubsubhelper.golang.org, Brad Fitzpatrick, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

                      Patch Set 11:

                      Patch Set 11:

                      Patch Set 11:

                      Patch Set 11:

                      Sorry for commenting this late in the review.

                      But I just saw a polyfill implementation of textencoder in the MDN site https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder#Polyfill. I think that is a better candidate to avoid licensing issues.

                      Also, the MDN docs point to this repo - https://github.com/inexorabletash/text-encoding which has a public license and has both encoding and decoding functions.

                      I know its a pain to change the algo at this stage of the review and I have no problems as such with the existing implementation. Up to Richard/Brad to take a final call.

                      I'm happy to do this, I just want confirmation first!

                      Unfortunately the gist https://gist.github.com/Yaffle/5458286 still has no license at all.

                      The license of MDN code snippets is CC0, which is good, but there seems to be no polyfill for the decoder.

                      The project https://github.com/inexorabletash/text-encoding is in the public domain as well, but it is quite large. What about just referencing it:

                        <!-- Polyfill for TextEncoder and TextDecoder -->
                      <script src="https://unpkg.com/text-e...@0.6.4/lib/encoding.js"></script>

                      That works. But I wouldn't want to inject a large script unconditionally. Let's check for TextEncoder support and then inject it if it's not there.

                      Something like this - 
                      if (!window.TextEncoder || !window.TextDecoder) {
                      let s = document.createElement('script');
                      s.src = "https://unpkg.com/text-e...@0.6.4/lib/encoding.js"
                      document.body.appendChild(s)
                      }

                      You could use https://cdn.jsdelivr.net/npm/text-e...@0.7.0/lib/encoding.min.js, which is only 5.6 KB on the wire. At this size I would prefer the simpler code.

                      View Change

                        To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

                        Gerrit-Project: go
                        Gerrit-Branch: master
                        Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                        Gerrit-Change-Number: 131718
                        Gerrit-PatchSet: 11
                        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                        Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                        Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
                        Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
                        Gerrit-CC: Agniva De Sarker <agniva.qu...@gmail.com>
                        Gerrit-CC: Gobot Gobot <go...@golang.org>
                        Gerrit-Comment-Date: Fri, 28 Sep 2018 07:55:32 +0000

                        Agniva De Sarker (Gerrit)

                        unread,
                        Sep 28, 2018, 4:43:11 AM9/28/18
                        to Jake Bentvelzen, Gerrit Bot, goph...@pubsubhelper.golang.org, Richard Musiol, Brad Fitzpatrick, Gobot Gobot, golang-co...@googlegroups.com

                        Patch Set 11:

                        Patch Set 11:

                        Patch Set 11:

                        Patch Set 11:

                        Patch Set 11:

                        Sorry for commenting this late in the review.

                        But I just saw a polyfill implementation of textencoder in the MDN site https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder#Polyfill. I think that is a better candidate to avoid licensing issues.

                        Also, the MDN docs point to this repo - https://github.com/inexorabletash/text-encoding which has a public license and has both encoding and decoding functions.

                        I know its a pain to change the algo at this stage of the review and I have no problems as such with the existing implementation. Up to Richard/Brad to take a final call.

                        I'm happy to do this, I just want confirmation first!

                        Unfortunately the gist https://gist.github.com/Yaffle/5458286 still has no license at all.

                        The license of MDN code snippets is CC0, which is good, but there seems to be no polyfill for the decoder.

                        The project https://github.com/inexorabletash/text-encoding is in the public domain as well, but it is quite large. What about just referencing it:

                          <!-- Polyfill for TextEncoder and TextDecoder -->
                        <script src="https://unpkg.com/text-e...@0.6.4/lib/encoding.js"></script>

                        That works. But I wouldn't want to inject a large script unconditionally. Let's check for TextEncoder support and then inject it if it's not there.

                        Something like this - 
                        if (!window.TextEncoder || !window.TextDecoder) {
                        let s = document.createElement('script');
                        s.src = "https://unpkg.com/text-e...@0.6.4/lib/encoding.js"
                        document.body.appendChild(s)
                        }

                        You could use https://cdn.jsdelivr.net/npm/text-e...@0.7.0/lib/encoding.min.js, which is only 5.6 KB on the wire. At this size I would prefer the simpler code.

                        SGTM.

                        View Change

                          To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

                          Gerrit-Project: go
                          Gerrit-Branch: master
                          Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                          Gerrit-Change-Number: 131718
                          Gerrit-PatchSet: 11
                          Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                          Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                          Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
                          Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
                          Gerrit-CC: Agniva De Sarker <agniva.qu...@gmail.com>
                          Gerrit-CC: Gobot Gobot <go...@golang.org>
                          Gerrit-Comment-Date: Fri, 28 Sep 2018 08:43:05 +0000

                          Jake Bentvelzen (Gerrit)

                          unread,
                          Sep 28, 2018, 4:48:39 AM9/28/18
                          to Gerrit Bot, goph...@pubsubhelper.golang.org, Richard Musiol, Brad Fitzpatrick, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

                          Patch Set 11:

                          Patch Set 11:

                          Patch Set 11:

                          Patch Set 11:

                          Patch Set 11:

                          Sorry for commenting this late in the review.

                          But I just saw a polyfill implementation of textencoder in the MDN site https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder#Polyfill. I think that is a better candidate to avoid licensing issues.

                          Also, the MDN docs point to this repo - https://github.com/inexorabletash/text-encoding which has a public license and has both encoding and decoding functions.

                          I know its a pain to change the algo at this stage of the review and I have no problems as such with the existing implementation. Up to Richard/Brad to take a final call.

                          I'm happy to do this, I just want confirmation first!

                          Unfortunately the gist https://gist.github.com/Yaffle/5458286 still has no license at all.

                          The license of MDN code snippets is CC0, which is good, but there seems to be no polyfill for the decoder.

                          The project https://github.com/inexorabletash/text-encoding is in the public domain as well, but it is quite large. What about just referencing it:

                            <!-- Polyfill for TextEncoder and TextDecoder -->
                          <script src="https://unpkg.com/text-e...@0.6.4/lib/encoding.js"></script>

                          That works. But I wouldn't want to inject a large script unconditionally. Let's check for TextEncoder support and then inject it if it's not there.

                          Something like this - 
                          if (!window.TextEncoder || !window.TextDecoder) {
                          let s = document.createElement('script');
                          s.src = "https://unpkg.com/text-e...@0.6.4/lib/encoding.js"
                          document.body.appendChild(s)
                          }

                          You could use https://cdn.jsdelivr.net/npm/text-e...@0.7.0/lib/encoding.min.js, which is only 5.6 KB on the wire. At this size I would prefer the simpler code.

                          I'm happy with either JS files being loaded. Keep in mind that make the polyfill work, I'd have to restructure the code to something like this:

                           <!doctype html>
                          <!--
                          Copyright 2018 The Go Authors. All rights reserved.
                          Use of this source code is governed by a BSD-style
                          license that can be found in the LICENSE file.
                          -->
                          <html>

                          <head>
                          <meta charset="utf-8">
                          <title>Go wasm</title>
                          </head>

                          <body>
                          <script>
                          let go;
                          let mod, inst;

                          if (!WebAssembly.instantiateStreaming) { // polyfill
                          WebAssembly.instantiateStreaming = async (resp, importObject) => {

                          const source = await (await resp).arrayBuffer();
                           				return await WebAssembly.instantiate(source, importObject);
                          };
                          }
                          // Add polyfill for TextEncoder and TextDecoder for Microsoft Edge 17/18 support
                          // https://caniuse.com/#feat=textencoder

                          if (!window.TextEncoder || !window.TextDecoder) {
                          let s = document.createElement('script');
                          s.src = "https://unpkg.com/text-e...@0.6.4/lib/encoding.js"
                           			s.onload = function() {
                          polyfillsInitialized();
                          };
                          document.head.appendChild(s)
                          } else {
                          polyfillsInitialized();
                          }
                          function polyfillsInitialized() {

                          let s = document.createElement('script');
                           			s.src = "wasm_exec.js"
                          s.onload = function() {
                          main();
                          };
                          document.head.appendChild(s)
                          }
                          function main() {
                          go = new Go();
                          WebAssembly.instantiateStreaming(fetch("test.wasm"), go.importObject).then((result) => {
                          mod = result.module;
                          inst = result.instance;
                          document.getElementById("runButton").disabled = false;
                          });
                          }
                          async function run() {
                          console.clear();
                          await go.run(inst);
                          inst = await WebAssembly.instantiate(mod, go.importObject); // reset instance
                          }
                          </script>
                          <button onClick="run();" id="runButton" disabled>Run</button>
                          </body>

                          </html>

                          View Change

                            To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

                            Gerrit-Project: go
                            Gerrit-Branch: master
                            Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                            Gerrit-Change-Number: 131718
                            Gerrit-PatchSet: 11
                            Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                            Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                            Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
                            Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
                            Gerrit-CC: Agniva De Sarker <agniva.qu...@gmail.com>
                            Gerrit-CC: Gobot Gobot <go...@golang.org>
                            Gerrit-Comment-Date: Fri, 28 Sep 2018 08:48:35 +0000

                            Agniva De Sarker (Gerrit)

                            unread,
                            Sep 28, 2018, 4:57:42 AM9/28/18
                            to Jake Bentvelzen, Gerrit Bot, goph...@pubsubhelper.golang.org, Richard Musiol, Brad Fitzpatrick, Gobot Gobot, golang-co...@googlegroups.com

                            Richard meant to include https://cdn.jsdelivr.net/npm/text-e...@0.7.0/lib/encoding.min.js directly in a script tag. Then you don't need any additional complexity.

                            View Change

                              To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

                              Gerrit-Project: go
                              Gerrit-Branch: master
                              Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                              Gerrit-Change-Number: 131718
                              Gerrit-PatchSet: 11
                              Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                              Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                              Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
                              Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
                              Gerrit-CC: Agniva De Sarker <agniva.qu...@gmail.com>
                              Gerrit-CC: Gobot Gobot <go...@golang.org>
                              Gerrit-Comment-Date: Fri, 28 Sep 2018 08:57:38 +0000

                              Gerrit Bot (Gerrit)

                              unread,
                              Sep 28, 2018, 6:47:10 AM9/28/18
                              to Jake Bentvelzen, Richard Musiol, Brad Fitzpatrick, goph...@pubsubhelper.golang.org, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

                              Gerrit Bot uploaded patch set #12 to this change.

                              View Change

                              misc/wasm: add polyfill for TextEncoder/TextDecoder for Edge support

                              Edge supports WASM but not TextEncoder or TextDecoder.
                              This PR adds a polyfill to `misc/wasm/wasm_exec.js` to fix this.

                              Fixes #27295

                              Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                              GitHub-Last-Rev: 07a8bfe9901b8418c45cefb1dca446bcadebd1de

                              GitHub-Pull-Request: golang/go#27296
                              ---
                              M misc/wasm/wasm_exec.html
                              1 file changed, 1 insertion(+), 0 deletions(-)

                              To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

                              Gerrit-Project: go
                              Gerrit-Branch: master
                              Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                              Gerrit-Change-Number: 131718
                              Gerrit-PatchSet: 12
                              Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                              Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                              Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
                              Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
                              Gerrit-CC: Agniva De Sarker <agniva.qu...@gmail.com>
                              Gerrit-CC: Gobot Gobot <go...@golang.org>
                              Gerrit-MessageType: newpatchset

                              Gerrit Bot (Gerrit)

                              unread,
                              Sep 28, 2018, 6:51:13 AM9/28/18
                              to Jake Bentvelzen, Richard Musiol, Brad Fitzpatrick, goph...@pubsubhelper.golang.org, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

                              Gerrit Bot uploaded patch set #13 to this change.

                              View Change

                              misc/wasm: add polyfill for TextEncoder/TextDecoder for Edge support

                              Edge supports WASM but not TextEncoder or TextDecoder.
                              This PR adds a polyfill to `misc/wasm/wasm_exec.js` to fix this.

                              Fixes #27295

                              Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                              GitHub-Last-Rev: 00722c49307b404a45b943a9fdf504e6db1d39d5

                              GitHub-Pull-Request: golang/go#27296
                              ---
                              M misc/wasm/wasm_exec.html
                              1 file changed, 5 insertions(+), 0 deletions(-)

                              To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

                              Gerrit-Project: go
                              Gerrit-Branch: master
                              Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                              Gerrit-Change-Number: 131718
                              Gerrit-PatchSet: 13

                              Jake Bentvelzen (Gerrit)

                              unread,
                              Sep 28, 2018, 6:51:30 AM9/28/18
                              to Gerrit Bot, goph...@pubsubhelper.golang.org, Richard Musiol, Brad Fitzpatrick, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

                              Patch Set 11:

                              Richard meant to include https://cdn.jsdelivr.net/npm/text-e...@0.7.0/lib/encoding.min.js directly in a script tag. Then you don't need any additional complexity.

                              Alright sounds good to me!
                              I gave it a test in Edge+Chrome and pushed it up!

                              View Change

                                To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

                                Gerrit-Project: go
                                Gerrit-Branch: master
                                Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                                Gerrit-Change-Number: 131718
                                Gerrit-PatchSet: 11
                                Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                                Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                                Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
                                Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
                                Gerrit-CC: Agniva De Sarker <agniva.qu...@gmail.com>
                                Gerrit-CC: Gobot Gobot <go...@golang.org>
                                Gerrit-Comment-Date: Fri, 28 Sep 2018 10:51:25 +0000

                                Richard Musiol (Gerrit)

                                unread,
                                Sep 28, 2018, 11:26:44 AM9/28/18
                                to Jake Bentvelzen, Gerrit Bot, goph...@pubsubhelper.golang.org, Brad Fitzpatrick, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

                                Patch set 13:Code-Review +1

                                View Change

                                1 comment:

                                To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

                                Gerrit-Project: go
                                Gerrit-Branch: master
                                Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                                Gerrit-Change-Number: 131718
                                Gerrit-PatchSet: 13
                                Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                                Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                                Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
                                Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
                                Gerrit-CC: Agniva De Sarker <agniva.qu...@gmail.com>
                                Gerrit-CC: Gobot Gobot <go...@golang.org>
                                Gerrit-Comment-Date: Fri, 28 Sep 2018 15:26:40 +0000
                                Gerrit-HasComments: Yes
                                Gerrit-Has-Labels: Yes
                                Gerrit-MessageType: comment

                                Gerrit Bot (Gerrit)

                                unread,
                                Sep 29, 2018, 12:06:07 AM9/29/18
                                to Jake Bentvelzen, Richard Musiol, Brad Fitzpatrick, goph...@pubsubhelper.golang.org, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

                                Gerrit Bot uploaded patch set #14 to this change.

                                View Change

                                misc/wasm: add polyfill for TextEncoder/TextDecoder for Edge support

                                Edge supports WASM but not TextEncoder or TextDecoder.
                                This PR adds a polyfill to `misc/wasm/wasm_exec.js` to fix this.

                                Fixes #27295

                                Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                                GitHub-Last-Rev: a587edae2806e1ca9b6be1c5dfd8824568373bdb

                                GitHub-Pull-Request: golang/go#27296
                                ---
                                M misc/wasm/wasm_exec.html
                                1 file changed, 5 insertions(+), 0 deletions(-)

                                To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

                                Gerrit-Project: go
                                Gerrit-Branch: master
                                Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                                Gerrit-Change-Number: 131718
                                Gerrit-PatchSet: 14
                                Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                                Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                                Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
                                Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
                                Gerrit-CC: Agniva De Sarker <agniva.qu...@gmail.com>
                                Gerrit-CC: Gobot Gobot <go...@golang.org>
                                Gerrit-MessageType: newpatchset

                                Agniva De Sarker (Gerrit)

                                unread,
                                Sep 29, 2018, 12:14:32 AM9/29/18
                                to Jake Bentvelzen, Gerrit Bot, goph...@pubsubhelper.golang.org, Richard Musiol, Brad Fitzpatrick, Gobot Gobot, golang-co...@googlegroups.com

                                Patch set 14:Code-Review +1

                                View Change

                                  To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

                                  Gerrit-Project: go
                                  Gerrit-Branch: master
                                  Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                                  Gerrit-Change-Number: 131718
                                  Gerrit-PatchSet: 14
                                  Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                                  Gerrit-Reviewer: Agniva De Sarker <agniva.qu...@gmail.com>
                                  Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                                  Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
                                  Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
                                  Gerrit-CC: Gobot Gobot <go...@golang.org>
                                  Gerrit-Comment-Date: Sat, 29 Sep 2018 04:14:28 +0000
                                  Gerrit-HasComments: No
                                  Gerrit-Has-Labels: Yes
                                  Gerrit-MessageType: comment

                                  Jake Bentvelzen (Gerrit)

                                  unread,
                                  Sep 29, 2018, 12:31:07 AM9/29/18
                                  to Gerrit Bot, goph...@pubsubhelper.golang.org, Agniva De Sarker, Richard Musiol, Brad Fitzpatrick, Gobot Gobot, golang-co...@googlegroups.com

                                  View Change

                                  1 comment:

                                  To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

                                  Gerrit-Project: go
                                  Gerrit-Branch: master
                                  Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                                  Gerrit-Change-Number: 131718
                                  Gerrit-PatchSet: 14
                                  Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                                  Gerrit-Reviewer: Agniva De Sarker <agniva.qu...@gmail.com>
                                  Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                                  Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
                                  Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
                                  Gerrit-CC: Gobot Gobot <go...@golang.org>
                                  Gerrit-Comment-Date: Sat, 29 Sep 2018 04:31:02 +0000
                                  Gerrit-HasComments: Yes
                                  Gerrit-Has-Labels: No

                                  Richard Musiol (Gerrit)

                                  unread,
                                  Sep 29, 2018, 6:02:00 AM9/29/18
                                  to Jake Bentvelzen, Gerrit Bot, goph...@pubsubhelper.golang.org, Agniva De Sarker, Brad Fitzpatrick, Gobot Gobot, golang-co...@googlegroups.com

                                  Patch set 14:Code-Review +2

                                  View Change

                                    To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

                                    Gerrit-Project: go
                                    Gerrit-Branch: master
                                    Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                                    Gerrit-Change-Number: 131718
                                    Gerrit-PatchSet: 14
                                    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                                    Gerrit-Reviewer: Agniva De Sarker <agniva.qu...@gmail.com>
                                    Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                                    Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
                                    Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
                                    Gerrit-CC: Gobot Gobot <go...@golang.org>
                                    Gerrit-Comment-Date: Sat, 29 Sep 2018 10:01:57 +0000

                                    Richard Musiol (Gerrit)

                                    unread,
                                    Sep 29, 2018, 6:08:03 AM9/29/18
                                    to Jake Bentvelzen, Gerrit Bot, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Agniva De Sarker, Brad Fitzpatrick, Gobot Gobot, golang-co...@googlegroups.com

                                    Richard Musiol merged this change.

                                    View Change

                                    Approvals: Richard Musiol: Looks good to me, approved Agniva De Sarker: Looks good to me, but someone else must approve
                                    misc/wasm: add polyfill for TextEncoder/TextDecoder for Edge support

                                    Edge supports WASM but not TextEncoder or TextDecoder.
                                    This PR adds a polyfill to `misc/wasm/wasm_exec.js` to fix this.

                                    Fixes #27295

                                    Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                                    GitHub-Last-Rev: a587edae2806e1ca9b6be1c5dfd8824568373bdb
                                    GitHub-Pull-Request: golang/go#27296
                                    Reviewed-on: https://go-review.googlesource.com/131718
                                    Reviewed-by: Agniva De Sarker <agniva.qu...@gmail.com>
                                    Reviewed-by: Richard Musiol <neel...@gmail.com>

                                    ---
                                    M misc/wasm/wasm_exec.html
                                    1 file changed, 5 insertions(+), 0 deletions(-)

                                    diff --git a/misc/wasm/wasm_exec.html b/misc/wasm/wasm_exec.html
                                    index f5e21e4..7ccdf0a 100644
                                    --- a/misc/wasm/wasm_exec.html
                                    +++ b/misc/wasm/wasm_exec.html
                                    @@ -12,6 +12,11 @@
                                    </head>

                                    <body>
                                    + <!--
                                    + Polyfill for TextEncoder and TextDecoder for Microsoft Edge 17/18 support
                                    + https://caniuse.com/#feat=textencoder
                                    + -->
                                    + <script src="https://cdn.jsdelivr.net/npm/text-e...@0.7.0/lib/encoding.min.js"></script>
                                    <script src="wasm_exec.js"></script>
                                    <script>
                                    if (!WebAssembly.instantiateStreaming) { // polyfill

                                    To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

                                    Gerrit-Project: go
                                    Gerrit-Branch: master
                                    Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                                    Gerrit-Change-Number: 131718
                                    Gerrit-PatchSet: 15
                                    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                                    Gerrit-Reviewer: Agniva De Sarker <agniva.qu...@gmail.com>
                                    Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                                    Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
                                    Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
                                    Gerrit-CC: Gobot Gobot <go...@golang.org>
                                    Gerrit-MessageType: merged

                                    Agniva De Sarker (Gerrit)

                                    unread,
                                    Sep 29, 2018, 8:00:27 AM9/29/18
                                    to Richard Musiol, Jake Bentvelzen, Gerrit Bot, goph...@pubsubhelper.golang.org, Brad Fitzpatrick, Gobot Gobot, golang-co...@googlegroups.com

                                    Patch Set 14: Code-Review+2

                                    Richard - This is a candidate for backport https://github.com/golang/go/issues/27393. Should we ?

                                    View Change

                                      To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

                                      Gerrit-Project: go
                                      Gerrit-Branch: master
                                      Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                                      Gerrit-Change-Number: 131718
                                      Gerrit-PatchSet: 15
                                      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                                      Gerrit-Reviewer: Agniva De Sarker <agniva.qu...@gmail.com>
                                      Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                                      Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
                                      Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
                                      Gerrit-CC: Gobot Gobot <go...@golang.org>
                                      Gerrit-Comment-Date: Sat, 29 Sep 2018 12:00:22 +0000

                                      Richard Musiol (Gerrit)

                                      unread,
                                      Sep 29, 2018, 8:20:30 AM9/29/18
                                      to Jake Bentvelzen, Gerrit Bot, goph...@pubsubhelper.golang.org, Agniva De Sarker, Brad Fitzpatrick, Gobot Gobot, golang-co...@googlegroups.com

                                      I'm not sure what our policy should be. The general policy on https://github.com/golang/go/wiki/MinorReleases says:

                                      Our default decision should always be to not backport, but fixes for regressions, security issues, and serious problems with no workaround are backported to the two supported major releases.

                                      One might say that having the latest of a modern browser crash on our wasm example is bad for adoption, so fixing this sooner than later is important. @Brad?

                                      View Change

                                        To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

                                        Gerrit-Project: go
                                        Gerrit-Branch: master
                                        Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                                        Gerrit-Change-Number: 131718
                                        Gerrit-PatchSet: 15
                                        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                                        Gerrit-Reviewer: Agniva De Sarker <agniva.qu...@gmail.com>
                                        Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                                        Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
                                        Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
                                        Gerrit-CC: Gobot Gobot <go...@golang.org>
                                        Gerrit-Comment-Date: Sat, 29 Sep 2018 12:20:26 +0000

                                        Brad Fitzpatrick (Gerrit)

                                        unread,
                                        Sep 29, 2018, 11:15:57 AM9/29/18
                                        to Richard Musiol, Jake Bentvelzen, Gerrit Bot, goph...@pubsubhelper.golang.org, Brad Fitzpatrick, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

                                        View Change

                                        1 comment:

                                        To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

                                        Gerrit-Project: go
                                        Gerrit-Branch: master
                                        Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                                        Gerrit-Change-Number: 131718
                                        Gerrit-PatchSet: 15
                                        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                                        Gerrit-Reviewer: Agniva De Sarker <agniva.qu...@gmail.com>
                                        Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                                        Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
                                        Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
                                        Gerrit-CC: Gobot Gobot <go...@golang.org>
                                        Gerrit-Comment-Date: Sat, 29 Sep 2018 15:15:54 +0000
                                        Gerrit-HasComments: Yes
                                        Gerrit-Has-Labels: No
                                        Gerrit-MessageType: comment

                                        Richard Musiol (Gerrit)

                                        unread,
                                        Sep 29, 2018, 12:01:12 PM9/29/18
                                        to Jake Bentvelzen, Gerrit Bot, goph...@pubsubhelper.golang.org, Brad Fitzpatrick, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

                                        View Change

                                        1 comment:

                                          • Sorry, this isn't acceptable. […]

                                            What exactly is the issue? Is it about third-party code that could change? If yes, then we could include a hash with the "integrity" attribute.

                                        To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

                                        Gerrit-Project: go
                                        Gerrit-Branch: master
                                        Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                                        Gerrit-Change-Number: 131718
                                        Gerrit-PatchSet: 15
                                        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                                        Gerrit-Reviewer: Agniva De Sarker <agniva.qu...@gmail.com>
                                        Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                                        Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
                                        Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
                                        Gerrit-CC: Gobot Gobot <go...@golang.org>
                                        Gerrit-Comment-Date: Sat, 29 Sep 2018 16:01:07 +0000
                                        Gerrit-HasComments: Yes
                                        Gerrit-Has-Labels: No
                                        Comment-In-Reply-To: Brad Fitzpatrick <brad...@golang.org>
                                        Gerrit-MessageType: comment

                                        Jake Bentvelzen (Gerrit)

                                        unread,
                                        Sep 30, 2018, 12:09:35 AM9/30/18
                                        to Richard Musiol, Gerrit Bot, goph...@pubsubhelper.golang.org, Brad Fitzpatrick, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

                                        Patch Set 15:

                                        (1 comment)

                                        View Change

                                        1 comment:

                                        To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

                                        Gerrit-Project: go
                                        Gerrit-Branch: master
                                        Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                                        Gerrit-Change-Number: 131718
                                        Gerrit-PatchSet: 15
                                        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                                        Gerrit-Reviewer: Agniva De Sarker <agniva.qu...@gmail.com>
                                        Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                                        Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
                                        Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
                                        Gerrit-CC: Gobot Gobot <go...@golang.org>
                                        Gerrit-Comment-Date: Sun, 30 Sep 2018 04:09:30 +0000
                                        Gerrit-HasComments: Yes
                                        Gerrit-Has-Labels: No
                                        Comment-In-Reply-To: Richard Musiol <neel...@gmail.com>

                                        Richard Musiol (Gerrit)

                                        unread,
                                        Sep 30, 2018, 1:10:29 PM9/30/18
                                        to Jake Bentvelzen, Gerrit Bot, goph...@pubsubhelper.golang.org, Brad Fitzpatrick, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

                                        View Change

                                        1 comment:

                                          • FYI, incase simply adding an integrity attribute isn't enough, we can do the more verbose "only load […]

                                            In that case we could make it simpler by putting the polyfill detection in a separate <script> tag and have it append the polyfill script tag conditionally. Browsers execute all <script> tags in order. However, I'd like to only do this if it solves the concrete issue. I'm not yet fully clear on what the issue is.

                                        To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

                                        Gerrit-Project: go
                                        Gerrit-Branch: master
                                        Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                                        Gerrit-Change-Number: 131718
                                        Gerrit-PatchSet: 15
                                        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                                        Gerrit-Reviewer: Agniva De Sarker <agniva.qu...@gmail.com>
                                        Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                                        Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
                                        Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
                                        Gerrit-CC: Gobot Gobot <go...@golang.org>
                                        Gerrit-Comment-Date: Sun, 30 Sep 2018 17:10:24 +0000
                                        Gerrit-HasComments: Yes
                                        Gerrit-Has-Labels: No
                                        Comment-In-Reply-To: Richard Musiol <neel...@gmail.com>
                                        Comment-In-Reply-To: Jake Bentvelzen <doogi...@gmail.com>

                                        Brad Fitzpatrick (Gerrit)

                                        unread,
                                        Oct 1, 2018, 6:58:07 PM10/1/18
                                        to Richard Musiol, Jake Bentvelzen, Gerrit Bot, goph...@pubsubhelper.golang.org, Brad Fitzpatrick, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

                                        View Change

                                        1 comment:

                                          • In that case we could make it simpler by putting the polyfill detection in a separate <script> tag a […]

                                            Two main reasons it's not acceptable:

                                            1) it adds a new dependency on a third-party service (jsdelivr.net)
                                            2) it makes all users pay the additional bandwidth+latency cost, even when it's not necessary

                                            I care about (2) much more than (1).

                                            If (2) was solved, then (1) would go away over time: eventually browsers will support whatever you're polyfilling and we'd never need to hit that service.

                                        To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

                                        Gerrit-Project: go
                                        Gerrit-Branch: master
                                        Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                                        Gerrit-Change-Number: 131718
                                        Gerrit-PatchSet: 15
                                        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                                        Gerrit-Reviewer: Agniva De Sarker <agniva.qu...@gmail.com>
                                        Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                                        Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
                                        Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
                                        Gerrit-CC: Gobot Gobot <go...@golang.org>
                                        Gerrit-Comment-Date: Mon, 01 Oct 2018 22:58:04 +0000

                                        Brad Fitzpatrick (Gerrit)

                                        unread,
                                        Oct 1, 2018, 6:59:14 PM10/1/18
                                        to Richard Musiol, Jake Bentvelzen, Gerrit Bot, goph...@pubsubhelper.golang.org, Brad Fitzpatrick, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

                                        Brad Fitzpatrick has created a revert of this change.

                                        View Change

                                        To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

                                        Gerrit-Project: go
                                        Gerrit-Branch: master
                                        Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                                        Gerrit-Change-Number: 131718
                                        Gerrit-PatchSet: 15
                                        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                                        Gerrit-Reviewer: Agniva De Sarker <agniva.qu...@gmail.com>
                                        Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                                        Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
                                        Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
                                        Gerrit-CC: Gobot Gobot <go...@golang.org>
                                        Gerrit-MessageType: revert

                                        Richard Musiol (Gerrit)

                                        unread,
                                        Oct 1, 2018, 7:57:11 PM10/1/18
                                        to Jake Bentvelzen, Gerrit Bot, goph...@pubsubhelper.golang.org, Brad Fitzpatrick, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

                                        View Change

                                        1 comment:

                                          • Two main reasons it's not acceptable: […]

                                            To me, wasm_exec.html is an example on how to embed Go in a web page. It is not a library that people include. For an example, I prefer simplicity.

                                            The overhead of 5.6 KB is very tiny compared to the size of the wasm binary that the Go compiler currently produces (premature optimization?). It also doesn't affect latency, since script tags get fetched concurrently. Eventually I would simply remove the polyfill from the example when it is not necessary any more. If you have a site and you want to support older browsers, you have to test and polyfill anyways. This wouldn't be the only polyfill that you need.

                                            I'm not yet convinced that this needs a change, but I'm also not strongly opposed to a change.

                                        To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

                                        Gerrit-Project: go
                                        Gerrit-Branch: master
                                        Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                                        Gerrit-Change-Number: 131718
                                        Gerrit-PatchSet: 15
                                        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                                        Gerrit-Reviewer: Agniva De Sarker <agniva.qu...@gmail.com>
                                        Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                                        Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
                                        Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
                                        Gerrit-CC: Gobot Gobot <go...@golang.org>
                                        Gerrit-Comment-Date: Mon, 01 Oct 2018 23:57:07 +0000

                                        Brad Fitzpatrick (Gerrit)

                                        unread,
                                        Oct 1, 2018, 8:21:40 PM10/1/18
                                        to Richard Musiol, Jake Bentvelzen, Gerrit Bot, goph...@pubsubhelper.golang.org, Brad Fitzpatrick, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

                                        View Change

                                        1 comment:

                                          • To me, wasm_exec.html is an example on how to embed Go in a web page. […]

                                            If it's just an example and you don't think most users will copy/paste this file without really reading it (as I assume), then move the script tag into the comment too. Then only users who read the comment can choose to support old browsers with the added latency hit.

                                            I don't see why this script tag won't block execution: how does the browser know that this script tag won't write to the document body? There's no "defer" attribute or whatever here.

                                        To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

                                        Gerrit-Project: go
                                        Gerrit-Branch: master
                                        Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                                        Gerrit-Change-Number: 131718
                                        Gerrit-PatchSet: 15
                                        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                                        Gerrit-Reviewer: Agniva De Sarker <agniva.qu...@gmail.com>
                                        Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                                        Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
                                        Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
                                        Gerrit-CC: Gobot Gobot <go...@golang.org>
                                        Gerrit-Comment-Date: Tue, 02 Oct 2018 00:21:37 +0000

                                        Agniva De Sarker (Gerrit)

                                        unread,
                                        Oct 2, 2018, 12:04:22 AM10/2/18
                                        to Richard Musiol, Jake Bentvelzen, Gerrit Bot, goph...@pubsubhelper.golang.org, Brad Fitzpatrick, Gobot Gobot, golang-co...@googlegroups.com

                                        Patch Set 15:

                                        (1 comment)

                                        View Change

                                        1 comment:

                                          • If it's just an example and you don't think most users will copy/paste this file without really read […]

                                            I am fine with moving it to a comment.

                                            Regarding blocking execution, I think what Richard meant was that other scripts get downloaded concurrently, but executed serially. So, it blocks execution, but not download.

                                        To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

                                        Gerrit-Project: go
                                        Gerrit-Branch: master
                                        Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                                        Gerrit-Change-Number: 131718
                                        Gerrit-PatchSet: 15
                                        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                                        Gerrit-Reviewer: Agniva De Sarker <agniva.qu...@gmail.com>
                                        Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                                        Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
                                        Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
                                        Gerrit-CC: Gobot Gobot <go...@golang.org>
                                        Gerrit-Comment-Date: Tue, 02 Oct 2018 04:04:18 +0000

                                        Richard Musiol (Gerrit)

                                        unread,
                                        Oct 2, 2018, 4:35:10 AM10/2/18
                                        to Jake Bentvelzen, Gerrit Bot, goph...@pubsubhelper.golang.org, Brad Fitzpatrick, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

                                        View Change

                                        1 comment:

                                          • I am fine with moving it to a comment. […]

                                            Exactly, it gets downloaded concurrently with wasm_exec.js and then the browser delays execution until all script tags above have been executed.

                                            The comment solution also sounds fine to me.

                                        To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

                                        Gerrit-Project: go
                                        Gerrit-Branch: master
                                        Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                                        Gerrit-Change-Number: 131718
                                        Gerrit-PatchSet: 15
                                        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                                        Gerrit-Reviewer: Agniva De Sarker <agniva.qu...@gmail.com>
                                        Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                                        Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
                                        Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
                                        Gerrit-CC: Gobot Gobot <go...@golang.org>
                                        Gerrit-Comment-Date: Tue, 02 Oct 2018 08:35:06 +0000
                                        Gerrit-HasComments: Yes
                                        Gerrit-Has-Labels: No
                                        Comment-In-Reply-To: Agniva De Sarker <agniva.qu...@gmail.com>

                                        Brad Fitzpatrick (Gerrit)

                                        unread,
                                        Oct 2, 2018, 11:59:09 AM10/2/18
                                        to Richard Musiol, Jake Bentvelzen, Gerrit Bot, goph...@pubsubhelper.golang.org, Brad Fitzpatrick, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

                                        View Change

                                        1 comment:

                                          • Exactly, it gets downloaded concurrently with wasm_exec. […]

                                            I did the revert with the assumption that you wanted to cherry-pick this back to the Go 1.11 branch where we'd only want a single commit, not a series of commits with fixes.

                                            If we don't need this in Go 1.11 now (because it'd be a no-op comment anyway), then we can just roll forward with commenting it out on master.

                                        To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

                                        Gerrit-Project: go
                                        Gerrit-Branch: master
                                        Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                                        Gerrit-Change-Number: 131718
                                        Gerrit-PatchSet: 15
                                        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                                        Gerrit-Reviewer: Agniva De Sarker <agniva.qu...@gmail.com>
                                        Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                                        Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
                                        Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
                                        Gerrit-CC: Gobot Gobot <go...@golang.org>
                                        Gerrit-Comment-Date: Tue, 02 Oct 2018 15:59:06 +0000

                                        Richard Musiol (Gerrit)

                                        unread,
                                        Oct 2, 2018, 1:21:11 PM10/2/18
                                        to Jake Bentvelzen, Gerrit Bot, goph...@pubsubhelper.golang.org, Brad Fitzpatrick, Agniva De Sarker, Gobot Gobot, golang-co...@googlegroups.com

                                        View Change

                                        1 comment:

                                          • I did the revert with the assumption that you wanted to cherry-pick this back to the Go 1. […]

                                            The point about the cherry-pick is a good one. I've prepared https://go-review.googlesource.com/c/go/+/139037. I think backporting might still be a good idea, because Edge support is probably a common issue right now. Filippo asked for a backport.

                                        To view, visit change 131718. To unsubscribe, or for help writing mail filters, visit settings.

                                        Gerrit-Project: go
                                        Gerrit-Branch: master
                                        Gerrit-Change-Id: Ie35ee5604529b170a5dc380eb286f71bdd691d3e
                                        Gerrit-Change-Number: 131718
                                        Gerrit-PatchSet: 15
                                        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                                        Gerrit-Reviewer: Agniva De Sarker <agniva.qu...@gmail.com>
                                        Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                                        Gerrit-Reviewer: Jake Bentvelzen <doogi...@gmail.com>
                                        Gerrit-Reviewer: Richard Musiol <neel...@gmail.com>
                                        Gerrit-CC: Gobot Gobot <go...@golang.org>
                                        Gerrit-Comment-Date: Tue, 02 Oct 2018 17:21:05 +0000
                                        Reply all
                                        Reply to author
                                        Forward
                                        0 new messages