babel / babel/minify

[bug] [safari] Causes a let declaration Syntax Error in Safari.

Open
#681 12 comments 1 reaction 0 assignees View on GitHub
needs info
Dominant language
JavaScript
Stars
4.4k
Forks
217
PR merge metrics
No merged PRs in 30d

Description

Oddly, this error doesn't happen in Chrome, only in Safari.

#### Input Code

Here's the non-minified code:

https://cdn.rawgit.com/trusktr/3248affba4a01a7ebf15f3cb0e68f18c/raw/b6b8258ced55798113d852c5b457f0df3bd033c5/not-minified.js

#### Actual Output

Here's the minified code:

https://cdn.rawgit.com/trusktr/3248affba4a01a7ebf15f3cb0e68f18c/raw/b6b8258ced55798113d852c5b457f0df3bd033c5/minified.js

#### Expected Output

It should work, not sure what the output should be. Here's the gist containing both files: https://gist.github.com/trusktr/3248affba4a01a7ebf15f3cb0e68f18c

#### Details

The following codepen uses the non-minified version. It works in Safari, you'll see a spinning square:
https://codepen.io/anon/pen/rzQmpK?editors=0010

The following pen is exactly the same, but it is using the minified version:
https://codepen.io/anon/pen/EvOmJM?editors=0010

In Safari, you will see errors with the minified version, that look like this:

![screen shot 2017-08-29 at 11 12 18 am](https://user-images.githubusercontent.com/297678/29836741-f7181646-8caa-11e7-849b-bfcb96c5e1a6.png)

If you run both of those pens in Chrome, they work fine. Only the non-minified pen works in Safari.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.