-
Notifications
You must be signed in to change notification settings - Fork 27.4k
chore(*): cleanup msie handling; add support comments #15407
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,8 +39,11 @@ describe('$location', function() { | |
/* global urlParsingNode: true */ | ||
var urlParsingNodePlaceholder; | ||
|
||
beforeEach(inject(function($sniffer) { | ||
if (msie) return; | ||
beforeEach(function() { | ||
// Support: non-Windows browsers | ||
// These tests expect a Windows environment which we can only guarantee | ||
// on IE & Edge. | ||
if (msie || /\bEdge\/[\d\.]+\b/.test(window.navigator.userAgent)) return; | ||
|
||
urlParsingNodePlaceholder = urlParsingNode; | ||
|
||
|
@@ -57,13 +60,14 @@ describe('$location', function() { | |
search: '', | ||
setAttribute: angular.noop | ||
}; | ||
})); | ||
}); | ||
|
||
afterEach(inject(function($sniffer) { | ||
if (msie) return; | ||
afterEach(function() { | ||
// Support: non-Windows browsers | ||
if (msie || /\bEdge\/[\d\.]+\b/.test(window.navigator.userAgent)) return; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be nice to have this as a reusable flag in tests. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess it doesn't hurt when it's used just in tests... (I would definitely not want sth like that in source). But would you like to have it in tests globally or just in I'm a little afraid of making it too easy to use UA-sniffing, though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it doesn't hurt. It is just about the mental overhead of "deciphering"
Fair enough 😃 |
||
//reset urlParsingNode | ||
urlParsingNode = urlParsingNodePlaceholder; | ||
})); | ||
}); | ||
|
||
|
||
it('should not include the drive name in path() on WIN', function() { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,9 +13,7 @@ describe('Scope', function() { | |
|
||
|
||
it('should expose the constructor', inject(function($rootScope) { | ||
if (msie < 11) return; | ||
// eslint-disable-next-line no-proto | ||
expect($rootScope.__proto__).toBe($rootScope.constructor.prototype); | ||
expect(Object.getPrototypeOf($rootScope)).toBe($rootScope.constructor.prototype); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was there only because of the Annex B (i.e. compatibility "don't use" stuff) |
||
})); | ||
|
||
|
||
|
@@ -125,7 +123,9 @@ describe('Scope', function() { | |
function Listener() { | ||
expect(this).toBeUndefined(); | ||
} | ||
if (msie < 10) return; | ||
// Support: IE 9 only | ||
// IE 9 doesn't support strict mode so its `this` will always be defined. | ||
if (msie === 9) return; | ||
$rootScope.$watch(Getter, Listener); | ||
$rootScope.$digest(); | ||
})); | ||
|
@@ -1227,6 +1227,7 @@ describe('Scope', function() { | |
})); | ||
|
||
|
||
// Support: IE 9 only | ||
if (msie === 9) { | ||
// See issue https://github.com/angular/angular.js/issues/10706 | ||
it('should completely disconnect all child scopes on IE9', inject(function($rootScope) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the difference between
Edge 13-14+
andEdge 13+
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the former we've checked that it, indeed, is broken in both v13 & v14. In the latter we've just checked v13 and the v14 state is unknown.