blakeembrey/free-style

Newer version 3.1.0+ breaks in strict mode - Octal escape sequences are not allowed in template strings

zhou opened this issue · 3 comments

zhou commented

Octal escape sequences are invalid in strict mode. We discovered this because typestyle made a major update a few weeks back and brought in free-style 3.1.0. And our app could not start and shows an error:
🚨 /<my_app>/node_modules/typestyle/node_modules/free-style/dist.es2015/index.js: Octal escape sequences are not allowed in template strings

After some googling, we found out that:
In Line 260 and 268, patterns like \0 should be escaped: \0. For example:
260: isUnique ? u\0${(++uniqueId).toString(36)} : s\0${pid}\0${style}
should be
260: isUnique ? u\\0${(++uniqueId).toString(36)} : s\\0${pid}\\0${style}

For your reference, a related issue in Babel is here: choojs/nanohtml#141

Sorry, can you clarify where it doesn’t work? I’m happy to catch this but I’ve been using it in node and browsers for a while without any issues.

zhou commented

Thanks for prompt resolution. Now we need to convey the message to typestyle to bring in the fix.