UglifyJs changes ascii characters to unicode for trim polyfill
See original GitHub issueBug Report or Feature Request (mark with an x)
- [X ] bug report -> please search issues before submitting
- [ ] feature request
Versions.
@angular/cli: 1.2.0 node: 6.9.0 os: win32 x64 @angular/common: 2.4.6 @angular/compiler: 2.4.6 @angular/core: 2.4.6 @angular/forms: 2.4.6 @angular/http: 2.4.6 @angular/platform-browser: 2.4.6 @angular/platform-browser-dynamic: 2.4.6
Repro steps.
Uncomment import ‘core-js/es6/string’; polyfill. Run ng build --prod Search in polyfills for “\u2028”
The log given by the failure.
“?A?”.trim() returns “A”
Desired functionality.
trim polyfill should escape:
module.exports = ‘\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003’ + ‘\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF’;
But this is replaced by:
exports=“\t\n\v\f\r \u2028\u2029\ufeff”
In some env, some unicode characters are replaced by ?, so now trim will remove ? from string.
Mention any other details that might be useful.
This can be avoid setting this for Uglify plugin: output: { ascii_only: true },
Could you have a look at this bug?
I can’t modify the environement use to run production build, and I don’t know it. But adding ascii_only would fix that.
Thanks!
Pierre
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)

Top Related StackOverflow Question
Good luck getting these guys to consider anything to do with any accommodations to environments other than their own https://github.com/angular/angular-cli/issues/6155 https://github.com/angular/angular-cli/issues/3544
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.