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

[BUG] Can't include Correlation Header on IE can fail #1260 #1266

Merged
merged 1 commit into from May 20, 2020

Conversation

MSNev
Copy link
Collaborator

@MSNev MSNev commented May 13, 2020

[BUG] ajax.ts is using string trim() which is not supported on IE7/8 #1251

[BUG] ajax.ts is using string trim() which is not supported on IE7/8 #1251
@MSNev MSNev requested a review from a team as a code owner May 13, 2020 05:19
@@ -423,7 +423,8 @@ export class Sender extends BaseTelemetryPlugin implements IChannelControlsAI {
this._retryAt = null;
} catch (e) {
/* Ignore this error for IE under v10 */
if (!Util.getIEVersion() || Util.getIEVersion() > 9) {
let ieVer = Util.getIEVersion();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using local var to save space for minification.

return (myNav.indexOf('msie') !== -1) ? parseInt(myNav.split('msie')[1]) : null;
if (myNav.indexOf("msie") !== -1) {
return parseInt(myNav.split("msie")[1]);
} else if (myNav.indexOf("trident/")) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding trident as not all IE userAgents always include MSIE


public static parseUrl(url: string): HTMLAnchorElement {
if (!UrlHelper.htmlAnchorElement) {
UrlHelper.htmlAnchorElement = !!UrlHelper.document.createElement ? UrlHelper.document.createElement('a') : { host: UrlHelper.parseHost(url) }; // fill host field in the fallback case as that is the only externally required field from this fn
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a test error with just using the single instance which caused the tests to occasionally fail -- as the used value kept getting overwritten.

errorMsg: "[%funcName%] is not supported in an ES3 environment, use CoreUtils.toISOString()",
ignoreFuncMatch: [
"CoreUtils.toISOString", // Make sure this isn't a reference to CoreUtils.isISOString()
"Utils.toISOString" // or if it's a reference to Utils.isISOString()
/CoreUtils(\$[\d]+)+\.toISOString/, // Make sure this isn't a reference to CoreUtils.isISOString(); CoreUtils$1.isISOString();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updating this to support an issue that Xiao was having while attempt to update the version of TypeScript which caused the CoreUtils reference to become CoreUtils$0.toISOString()

@@ -190,6 +190,14 @@ export const defaultEs3CheckTokens:IEs3CheckKeyword[] = [
{
funcNames: [ /[\s\(,][gs]et[\s]+([\w]+)[\s]*\(\)[\s]*\{/g ],
errorMsg: "[%funcName%] is not supported in an ES3 environment."
},
{
funcNames: [ /([\w0-9]*)\.(trim)[\s]*\(/g ],
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add check for string trim() which is not supported on ES3

@MSNev MSNev changed the title [BUG] Can include Correlation Header on IE can fail #1260 [BUG] Can't include Correlation Header on IE can fail #1260 May 13, 2020
@MSNev MSNev merged commit 7b9f238 into master May 20, 2020
@MSNev MSNev added this to the 2.5.5 milestone Jun 2, 2020
@MSNev MSNev deleted the MSNev/IEIssue branch August 15, 2020 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants