Skip to content

Syntax errors after minifying unicode #415

@danprince

Description

@danprince

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed bughas PRHas an open PR that fixes this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions