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

Commit 999138a

Browse files
committed
WIP - debug Mobile Safari 8
1 parent dcbb707 commit 999138a

File tree

4 files changed

+52
-10
lines changed

4 files changed

+52
-10
lines changed

Diff for: .travis.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ branches:
1515

1616
env:
1717
matrix:
18-
- JOB=ci-checks
18+
# - JOB=ci-checks
1919
- JOB=unit BROWSER_PROVIDER=saucelabs
20-
- JOB=docs-e2e BROWSER_PROVIDER=saucelabs
21-
- JOB=e2e TEST_TARGET=jqlite BROWSER_PROVIDER=saucelabs
22-
- JOB=e2e TEST_TARGET=jquery BROWSER_PROVIDER=saucelabs
20+
# - JOB=docs-e2e BROWSER_PROVIDER=saucelabs
21+
# - JOB=e2e TEST_TARGET=jqlite BROWSER_PROVIDER=saucelabs
22+
# - JOB=e2e TEST_TARGET=jquery BROWSER_PROVIDER=saucelabs
2323
global:
2424
- CXX=g++-4.8 # node 4 likes the G++ v4.8 compiler
2525
- SAUCE_USERNAME=angular-ci

Diff for: Gruntfile.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,8 @@ module.exports = function(grunt) {
329329
grunt.registerTask('test:jquery-2.1', 'Run the jQuery 2.1 unit tests with Karma', ['tests:jquery-2.1']);
330330
grunt.registerTask('test:modules', 'Run the Karma module tests with Karma', ['build', 'tests:modules']);
331331
grunt.registerTask('test:docs', 'Run the doc-page tests with Karma', ['package', 'tests:docs']);
332-
grunt.registerTask('test:unit', 'Run unit, jQuery and Karma module tests with Karma', ['test:jqlite', 'test:jquery', 'test:jquery-2.2', 'test:jquery-2.1', 'test:modules']);
332+
// grunt.registerTask('test:unit', 'Run unit, jQuery and Karma module tests with Karma', ['test:jqlite', 'test:jquery', 'test:jquery-2.2', 'test:jquery-2.1', 'test:modules']);
333+
grunt.registerTask('test:unit', 'Run unit, jQuery and Karma module tests with Karma', ['test:jqlite']);
333334
grunt.registerTask('test:protractor', 'Run the end to end tests with Protractor and keep a test server running in the background', ['webdriver', 'connect:testserver', 'protractor:normal']);
334335
grunt.registerTask('test:travis-protractor', 'Run the end to end tests with Protractor for Travis CI builds', ['connect:testserver', 'protractor:travis']);
335336
grunt.registerTask('test:ci-protractor', 'Run the end to end tests with Protractor for Jenkins CI builds', ['webdriver', 'connect:testserver', 'protractor:jenkins']);

Diff for: scripts/travis/build.sh

+4-3
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ elif [ "$JOB" == "unit" ]; then
1111
if [ "$BROWSER_PROVIDER" == "browserstack" ]; then
1212
BROWSERS="BS_Chrome,BS_Safari,BS_Firefox,BS_IE_9,BS_IE_10,BS_IE_11,BS_iOS"
1313
else
14-
BROWSERS="SL_Chrome,SL_Firefox,SL_Safari_8,SL_Safari_9,SL_IE_9,SL_IE_10,SL_IE_11,SL_iOS"
14+
# BROWSERS="SL_Chrome,SL_Firefox,SL_Safari_8,SL_Safari_9,SL_IE_9,SL_IE_10,SL_IE_11,SL_iOS"
15+
BROWSERS="SL_Chrome,SL_iOS"
1516
fi
1617

17-
grunt test:promises-aplus
18+
# grunt test:promises-aplus
1819
grunt test:unit --browsers="$BROWSERS" --reporters=dots
19-
grunt tests:docs --browsers="$BROWSERS" --reporters=dots
20+
# grunt tests:docs --browsers="$BROWSERS" --reporters=dots
2021
elif [ "$JOB" == "docs-e2e" ]; then
2122
grunt test:travis-protractor --specs="docs/app/e2e/**/*.scenario.js"
2223
elif [ "$JOB" == "e2e" ]; then

Diff for: src/apis.js

+42-2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ function NgMapShim() {
4242
this._values = [];
4343
this._lastKey = NaN;
4444
this._lastIndex = -1;
45+
46+
this._map = new window.Map();
4547
}
4648
NgMapShim.prototype = {
4749
_idx: function(key) {
@@ -52,17 +54,41 @@ NgMapShim.prototype = {
5254
this._lastIndex = this._keys.indexOf(key);
5355
return this._lastIndex;
5456
},
57+
_reportDiff: function(method, key, value, _value, len, _len) {
58+
console.log('-------------------------');
59+
console.log('DIFF in `' + method + '`:');
60+
console.log(' len1 :', len);
61+
console.log(' len2 :', _len);
62+
console.log(' value1:', value);
63+
console.log(' value2:', _value);
64+
console.log(' key :', key);
65+
console.log(' entries2:');
66+
67+
this._map.forEach(function(e) {
68+
console.log(' ', e);
69+
});
70+
},
5571
_transformKey: function(key) {
5672
return isNumberNaN(key) ? nanKey : key;
5773
},
5874
get: function(key) {
75+
var _value = this._map.get(key);
5976
key = this._transformKey(key);
6077
var idx = this._idx(key);
6178
if (idx !== -1) {
62-
return this._values[idx];
79+
var value = this._values[idx];
80+
var len = this._keys.length;
81+
var _len = this._map.size;
82+
if (value !== _value) this._reportDiff('GET', key, value, _value, len, _len);
83+
return value;
6384
}
85+
var len = this._keys.length;
86+
var _len = this._map.size;
87+
if (_value !== undefined) this._reportDiff('GET', key, undefined, _value, len, _len);
6488
},
6589
set: function(key, value) {
90+
this._map.set(key, value);
91+
6692
key = this._transformKey(key);
6793
var idx = this._idx(key);
6894
if (idx === -1) {
@@ -71,25 +97,39 @@ NgMapShim.prototype = {
7197
this._keys[idx] = key;
7298
this._values[idx] = value;
7399

100+
var len = this._keys.length;
101+
var _len = this._map.size;
102+
if (len !== _len) this._reportDiff('SET', key, value, undefined, len, _len);
103+
74104
// Support: IE11
75105
// Do not `return this` to simulate the partial IE11 implementation
76106
},
77107
delete: function(key) {
108+
var _value = this._map.delete(key);
78109
key = this._transformKey(key);
79110
var idx = this._idx(key);
80111
if (idx === -1) {
112+
var len = this._keys.length;
113+
var _len = this._map.size;
114+
if (_value) this._reportDiff('DELETE', key, false, _value, len, _len);
81115
return false;
82116
}
83117
this._keys.splice(idx, 1);
84118
this._values.splice(idx, 1);
85119
this._lastKey = NaN;
86120
this._lastIndex = -1;
121+
122+
var len = this._keys.length;
123+
var _len = this._map.size;
124+
if (!_value) this._reportDiff('DELETE', key, true, _value, len, _len);
125+
if (len !== _len) this._reportDiff('DELETE_', key, true, _value, len, _len);
126+
87127
return true;
88128
}
89129
};
90130

91131
var NgMap = isFunction(window.Map) && toString.call(window.Map.prototype) === '[object Map]'
92-
? window.Map
132+
? NgMapShim//window.Map
93133
: NgMapShim;
94134

95135
var $$MapProvider = [/** @this */function() {

0 commit comments

Comments
 (0)