Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax errors after minifying unicode #415

Closed
danprince opened this issue Feb 10, 2017 · 0 comments
Closed

Syntax errors after minifying unicode #415

danprince opened this issue Feb 10, 2017 · 0 comments
Labels
bug Confirmed bug has PR Has an open PR that fixes this issue
Milestone

Comments

@danprince
Copy link

danprince commented Feb 10, 2017

Trying to use mathiasbynens/he to encode html entities in the browser, but after adding the library, the app has started getting syntax errors in Safari and Firefox.

The offending character seems to be a unicode character, that appears in the source after minification.

Here's the result of running the corresponding snippet of code in Babel's REPL with Babili enabled:

let a = { '\u2118':'wp' };
// becomes
'use strict';var a={:'wp'};

Visiting that link in Firefox 50.1.0 results in an "Illegal character error" in the REPL. Seeing as it works fine without Babili, I'm guessing this is a bug, rather than a deliberate constraint.

Pretty sure it happens in babel-plugin-transform-property-literals as it turns the string into a literal key.

@boopathi boopathi added bug Confirmed bug has PR Has an open PR that fixes this issue labels Feb 20, 2017
@boopathi boopathi modified the milestone: 1.0 Apr 6, 2017
@boopathi boopathi moved this from Issues to Closed in Object/Class Properties/Members Jun 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bug has PR Has an open PR that fixes this issue
Development

Successfully merging a pull request may close this issue.

2 participants