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

Commit f4ba0e3

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

File tree

4 files changed

+50
-10
lines changed

4 files changed

+50
-10
lines changed

.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

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']);

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

src/apis.js

+40-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,39 @@ 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:', this._map.entries(), Object.keys(this._map.entries()));
66+
console.log(' keys2:', this._map.keys());
67+
console.log(' values2:', this._map.values());
68+
},
5569
_transformKey: function(key) {
5670
return isNumberNaN(key) ? nanKey : key;
5771
},
5872
get: function(key) {
73+
var _value = this._map.get(key);
5974
key = this._transformKey(key);
6075
var idx = this._idx(key);
6176
if (idx !== -1) {
62-
return this._values[idx];
77+
var value = this._values[idx];
78+
var len = this._keys.length;
79+
var _len = this._map.size;
80+
if (value !== _value) this._reportDiff('GET', key, value, _value, len, _len);
81+
return value;
6382
}
83+
var len = this._keys.length;
84+
var _len = this._map.size;
85+
if (_value !== undefined) this._reportDiff('GET', key, undefined, _value, len, _len);
6486
},
6587
set: function(key, value) {
88+
this._map.set(key, value);
89+
6690
key = this._transformKey(key);
6791
var idx = this._idx(key);
6892
if (idx === -1) {
@@ -71,25 +95,39 @@ NgMapShim.prototype = {
7195
this._keys[idx] = key;
7296
this._values[idx] = value;
7397

98+
var len = this._keys.length;
99+
var _len = this._map.size;
100+
if (len !== _len) this._reportDiff('SET', key, value, undefined, len, _len);
101+
74102
// Support: IE11
75103
// Do not `return this` to simulate the partial IE11 implementation
76104
},
77105
delete: function(key) {
106+
var _value = this._map.delete(key);
78107
key = this._transformKey(key);
79108
var idx = this._idx(key);
80109
if (idx === -1) {
110+
var len = this._keys.length;
111+
var _len = this._map.size;
112+
if (_value) this._reportDiff('DELETE', key, false, _value, len, _len);
81113
return false;
82114
}
83115
this._keys.splice(idx, 1);
84116
this._values.splice(idx, 1);
85117
this._lastKey = NaN;
86118
this._lastIndex = -1;
119+
120+
var len = this._keys.length;
121+
var _len = this._map.size;
122+
if (!_value) this._reportDiff('DELETE', key, true, _value, len, _len);
123+
if (len !== _len) this._reportDiff('DELETE_', key, true, _value, len, _len);
124+
87125
return true;
88126
}
89127
};
90128

91129
var NgMap = isFunction(window.Map) && toString.call(window.Map.prototype) === '[object Map]'
92-
? window.Map
130+
? NgMapShim//window.Map
93131
: NgMapShim;
94132

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

0 commit comments

Comments
 (0)