Closed headerbidding closed 7 years ago
@headerbidding I can't reproduce this issue.
Edit: sent you an email
Error was caused by using a text editor that dropped "text containing characters that cannot be represented in the file’s character set” from the javascript code.
@headerbidding Sorry for all the hassle. Glad you figured it out finally.
Is it allowed for Javascript code to have non-standard characters? Up to Version 18, running the prebid.js javascript through a html text editor has not been a problem.
The exact character that broke the code for my javascript editor (Microsoft Expression Web) was this one: �
It is part of this sequence: w=[" \n�\f\r Â áš€á Žâ€€â€�  ","        â�Ÿã€€\
I am suspicious that the code may be corrupted... and even though it "works", I am hesitant to use it. It just doesn't look right to me. And even Microsoft Expression Web's javascript editor can't handle it....
Note: the character "�" does not display correctly here. It is the circle with arrow (male sign) ♂ symbol.
After further testing, I found that this issue does ALSO occur if I only choose the appnexus adapter.
Suspicious code section: RegExp.prototype.test,E),I=[" \n\f\r "," \u2028","\u2029"].
You'll find it if you search for "RegExp.prototype.test"
This is a complex topic, but to summarize, no a JS string can contain any UTF-16 encoded character. This is a superset of ASCII.
The reason why this is occurring in the build now is because of a change we made to include some polyfills for IE. The polyfill contains this source code: https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 (spec: http://es5.github.io/#WhiteSpace )
The characters that seem strange, are representations of whitespace / tabs. These get converted down to UTF-8 representations with the Uglify JS plugin.
This all seems valid to me.
0-19-0 prebid.js breaks the javascript code and I get a "Invalid or unexpected token" error.