Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@nightscape
Copy link
Contributor

Before this change, the code gets compiled to the following JS:

      var await = $uZ(await$2);
        var $$x3;
        if (await) {
          var this$8 = this$2$1.Lzio_test_environment_package$TestClock$Test__f_warningStart;
          var that = new $c_sjsr_AnonFunction0(((this$7, promise$1$1) => (() => promise$1$1.await__Lzio_ZIO()))(this$2$1, promise$3));
          $$x3 = $f_Lzio_ZIO__$times$greater__F0__Lzio_ZIO(this$8, that)
        } else {
          $$x3 = promise$3.succeed__O__Lzio_ZIO((void 0))
        };

Unfortunately, this throws an error in Firefox (and potentially other browsers):

Uncaught SyntaxError: await is a reserved identifier

I've searched through the generated JS code, and this seems to be the only occurrence of await without any prefix or suffix, so hopefully this change should fix the problem.

This code gets compiled to the following JS:
```javascript
      var await = $uZ(await$2);
        var $$x3;
        if (await) {
          var this$8 = this$2$1.Lzio_test_environment_package$TestClock$Test__f_warningStart;
          var that = new $c_sjsr_AnonFunction0(((this$7, promise$1$1) => (() => promise$1$1.await__Lzio_ZIO()))(this$2$1, promise$3));
          $$x3 = $f_Lzio_ZIO__$times$greater__F0__Lzio_ZIO(this$8, that)
        } else {
          $$x3 = promise$3.succeed__O__Lzio_ZIO((void 0))
        };
```
Unfortunately, this throws an error in Firefox (and potentially other browsers):
```
Uncaught SyntaxError: await is a reserved identifier
```
I've searched through the generated JS code, and this seems to be the only occurrence of `await` without any prefix or suffix, so hopefully this change should fix the problem.
Copy link
Contributor

@adamgfraser adamgfraser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very interesting! Thank you!

@mijicd @softinio I wonder if we need to add something like this to our build matrix so we catch issues like this in advance.

@adamgfraser adamgfraser merged commit 6e80186 into zio:master Mar 26, 2021
@nightscape nightscape deleted the patch-2 branch March 26, 2021 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants