Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 604d876

Browse files
committed
fixup! refactor(*): replace HashMap with NgMap (former ES6Map)
1 parent dcbb707 commit 604d876

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

Diff for: src/apis.js

+13-3
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,19 @@ NgMapShim.prototype = {
8888
}
8989
};
9090

91-
var NgMap = isFunction(window.Map) && toString.call(window.Map.prototype) === '[object Map]'
92-
? window.Map
93-
: NgMapShim;
91+
// Support: Mobile Safari < 9
92+
function isNotSafari8BuggyImplementation(Map) {
93+
// Although we don't need the tested feature (`.keys().next()`), its absence indicates a buggy
94+
// implementation, such as the one of [Mobile] Safari 8, which sometimes leads to failures
95+
// (e.g. failing to get a value associated with a jqLite collection).
96+
var m = new Map();
97+
return isFunction(m.keys) && isFunction(m.keys().next);
98+
}
99+
100+
var NgMap = isFunction(window.Map) && toString.call(window.Map.prototype) === '[object Map]' &&
101+
isNotSafari8BuggyImplementation(window.Map) ?
102+
window.Map :
103+
NgMapShim;
94104

95105
var $$MapProvider = [/** @this */function() {
96106
this.$get = [function() {

0 commit comments

Comments
 (0)