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

Commit e5fa562

Browse files
committed
hore: release v0.8.18
1 parent 4ba5d97 commit e5fa562

21 files changed

+10034
-605
lines changed

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
<a name="0.8.18"></a>
2+
## [0.8.18](https://github.com/angular/zone.js/compare/v0.8.17...0.8.18) (2017-09-27)
3+
4+
5+
### Bug Fixes
6+
7+
* **event:** EventTarget of SourceBuffer in samsung tv will have null context ([#904](https://github.com/angular/zone.js/issues/904)) ([8718e07](https://github.com/angular/zone.js/commit/8718e07))
8+
* **event:** fix [#883](https://github.com/angular/zone.js/issues/883), fix RTCPeerConnection Safari event not triggered issue ([#905](https://github.com/angular/zone.js/issues/905)) ([6f74efb](https://github.com/angular/zone.js/commit/6f74efb))
9+
* **event:** fix [#911](https://github.com/angular/zone.js/issues/911), in IE, event handler event maybe undefined ([#913](https://github.com/angular/zone.js/issues/913)) ([4ba5d97](https://github.com/angular/zone.js/commit/4ba5d97))
10+
* **event:** should handle event.stopImmediatePropagration ([#903](https://github.com/angular/zone.js/issues/903)) ([dcc285a](https://github.com/angular/zone.js/commit/dcc285a))
11+
* **patch:** patchOnProperty getter should return original listener ([#887](https://github.com/angular/zone.js/issues/887)) ([d4e5ae8](https://github.com/angular/zone.js/commit/d4e5ae8))
12+
* **patch:** Worker should patch onProperties ([#915](https://github.com/angular/zone.js/issues/915)) ([418a583](https://github.com/angular/zone.js/commit/418a583))
13+
* **promise:** can set native promise after loading zone.js ([#899](https://github.com/angular/zone.js/issues/899)) ([956c729](https://github.com/angular/zone.js/commit/956c729))
14+
* **timer:** fix [#314](https://github.com/angular/zone.js/issues/314), setTimeout/interval should return original timerId ([#894](https://github.com/angular/zone.js/issues/894)) ([aec4bd4](https://github.com/angular/zone.js/commit/aec4bd4))
15+
16+
17+
### Features
18+
19+
* **compile:** fix [#892](https://github.com/angular/zone.js/issues/892), upgrade to typescript 2.3.4, support for...of when build zone-node ([#897](https://github.com/angular/zone.js/issues/897)) ([e999593](https://github.com/angular/zone.js/commit/e999593))
20+
* **spec:** log URL in error when attempting XHR from FakeAsyncTestZone ([#893](https://github.com/angular/zone.js/issues/893)) ([874bfdc](https://github.com/angular/zone.js/commit/874bfdc))
21+
22+
23+
124
<a name="0.8.17"></a>
225
## [0.8.17](https://github.com/angular/zone.js/compare/v0.8.16...0.8.17) (2017-08-23)
326

dist/fake-async-test.js

Lines changed: 47 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,14 @@
6363
}
6464
}
6565
};
66-
Scheduler.prototype.tick = function (millis) {
66+
Scheduler.prototype.tick = function (millis, doTick) {
6767
if (millis === void 0) { millis = 0; }
6868
var finalTime = this._currentTime + millis;
69+
var lastCurrentTime = 0;
70+
if (this._schedulerQueue.length === 0 && doTick) {
71+
doTick(millis);
72+
return;
73+
}
6974
while (this._schedulerQueue.length > 0) {
7075
var current = this._schedulerQueue[0];
7176
if (finalTime < current.endTime) {
@@ -75,7 +80,11 @@
7580
else {
7681
// Time to run scheduled function. Remove it from the head of queue.
7782
var current_1 = this._schedulerQueue.shift();
83+
lastCurrentTime = this._currentTime;
7884
this._currentTime = current_1.endTime;
85+
if (doTick) {
86+
doTick(this._currentTime - lastCurrentTime);
87+
}
7988
var retval = current_1.func.apply(global, current_1.args);
8089
if (!retval) {
8190
// Uncaught exception in the current scheduled function. Stop processing the queue.
@@ -85,43 +94,50 @@
8594
}
8695
this._currentTime = finalTime;
8796
};
88-
Scheduler.prototype.flush = function (limit, flushPeriodic) {
89-
var _this = this;
97+
Scheduler.prototype.flush = function (limit, flushPeriodic, doTick) {
9098
if (limit === void 0) { limit = 20; }
9199
if (flushPeriodic === void 0) { flushPeriodic = false; }
100+
if (flushPeriodic) {
101+
return this.flushPeriodic(doTick);
102+
}
103+
else {
104+
return this.flushNonPeriodic(limit, doTick);
105+
}
106+
};
107+
Scheduler.prototype.flushPeriodic = function (doTick) {
108+
if (this._schedulerQueue.length === 0) {
109+
return 0;
110+
}
111+
// Find the last task currently queued in the scheduler queue and tick
112+
// till that time.
113+
var startTime = this._currentTime;
114+
var lastTask = this._schedulerQueue[this._schedulerQueue.length - 1];
115+
this.tick(lastTask.endTime - startTime, doTick);
116+
return this._currentTime - startTime;
117+
};
118+
Scheduler.prototype.flushNonPeriodic = function (limit, doTick) {
92119
var startTime = this._currentTime;
120+
var lastCurrentTime = 0;
93121
var count = 0;
94-
var seenTimers = [];
95122
while (this._schedulerQueue.length > 0) {
96123
count++;
97124
if (count > limit) {
98125
throw new Error('flush failed after reaching the limit of ' + limit +
99126
' tasks. Does your code use a polling timeout?');
100127
}
101-
if (!flushPeriodic) {
102-
// flush only non-periodic timers.
103-
// If the only remaining tasks are periodic(or requestAnimationFrame), finish flushing.
104-
if (this._schedulerQueue.filter(function (task) { return !task.isPeriodic && !task.isRequestAnimationFrame; })
105-
.length === 0) {
106-
break;
107-
}
108-
}
109-
else {
110-
// flushPeriodic has been requested.
111-
// Stop when all timer id-s have been seen at least once.
112-
if (this._schedulerQueue
113-
.filter(function (task) {
114-
return seenTimers.indexOf(task.id) === -1 || _this._currentTime === task.endTime;
115-
})
116-
.length === 0) {
117-
break;
118-
}
128+
// flush only non-periodic timers.
129+
// If the only remaining tasks are periodic(or requestAnimationFrame), finish flushing.
130+
if (this._schedulerQueue.filter(function (task) { return !task.isPeriodic && !task.isRequestAnimationFrame; })
131+
.length === 0) {
132+
break;
119133
}
120134
var current = this._schedulerQueue.shift();
121-
if (seenTimers.indexOf(current.id) === -1) {
122-
seenTimers.push(current.id);
123-
}
135+
lastCurrentTime = this._currentTime;
124136
this._currentTime = current.endTime;
137+
if (doTick) {
138+
// Update any secondary schedulers like Jasmine mock Date.
139+
doTick(this._currentTime - lastCurrentTime);
140+
}
125141
var retval = current.func.apply(global, current.args);
126142
if (!retval) {
127143
// Uncaught exception in the current scheduled function. Stop processing the queue.
@@ -241,11 +257,11 @@
241257
this._lastError = null;
242258
throw error;
243259
};
244-
FakeAsyncTestZoneSpec.prototype.tick = function (millis) {
260+
FakeAsyncTestZoneSpec.prototype.tick = function (millis, doTick) {
245261
if (millis === void 0) { millis = 0; }
246262
FakeAsyncTestZoneSpec.assertInZone();
247263
this.flushMicrotasks();
248-
this._scheduler.tick(millis);
264+
this._scheduler.tick(millis, doTick);
249265
if (this._lastError !== null) {
250266
this._resetLastErrorAndThrow();
251267
}
@@ -265,10 +281,10 @@
265281
}
266282
flushErrors();
267283
};
268-
FakeAsyncTestZoneSpec.prototype.flush = function (limit, flushPeriodic) {
284+
FakeAsyncTestZoneSpec.prototype.flush = function (limit, flushPeriodic, doTick) {
269285
FakeAsyncTestZoneSpec.assertInZone();
270286
this.flushMicrotasks();
271-
var elapsed = this._scheduler.flush(limit, flushPeriodic);
287+
var elapsed = this._scheduler.flush(limit, flushPeriodic, doTick);
272288
if (this._lastError !== null) {
273289
this._resetLastErrorAndThrow();
274290
}
@@ -305,7 +321,8 @@
305321
this._setInterval(task.invoke, task.data['delay'], task.data['args']);
306322
break;
307323
case 'XMLHttpRequest.send':
308-
throw new Error('Cannot make XHRs from within a fake async test.');
324+
throw new Error('Cannot make XHRs from within a fake async test. Request URL: ' +
325+
task.data['url']);
309326
case 'requestAnimationFrame':
310327
case 'webkitRequestAnimationFrame':
311328
case 'mozRequestAnimationFrame':

dist/webapis-rtc-peer-connection.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
* @license
3+
* Copyright Google Inc. All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
(function (global, factory) {
9+
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
10+
typeof define === 'function' && define.amd ? define(factory) :
11+
(factory());
12+
}(this, (function () { 'use strict';
13+
14+
/**
15+
* @license
16+
* Copyright Google Inc. All Rights Reserved.
17+
*
18+
* Use of this source code is governed by an MIT-style license that can be
19+
* found in the LICENSE file at https://angular.io/license
20+
*/
21+
Zone.__load_patch('RTCPeerConnection', function (global, Zone, api) {
22+
var RTCPeerConnection = global['RTCPeerConnection'];
23+
if (!RTCPeerConnection) {
24+
return;
25+
}
26+
var addSymbol = api.symbol('addEventListener');
27+
var removeSymbol = api.symbol('removeEventListener');
28+
RTCPeerConnection.prototype.addEventListener = RTCPeerConnection.prototype[addSymbol];
29+
RTCPeerConnection.prototype.removeEventListener = RTCPeerConnection.prototype[removeSymbol];
30+
// RTCPeerConnection extends EventTarget, so we must clear the symbol
31+
// to allow pathc RTCPeerConnection.prototype.addEventListener again
32+
RTCPeerConnection.prototype[addSymbol] = null;
33+
RTCPeerConnection.prototype[removeSymbol] = null;
34+
api.patchEventTarget(global, [RTCPeerConnection.prototype], { useGlobalCallback: false });
35+
});
36+
37+
})));

dist/webapis-rtc-peer-connection.min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/wtf.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
* Use of this source code is governed by an MIT-style license that can be
1919
* found in the LICENSE file at https://angular.io/license
2020
*/
21+
/**
22+
* @fileoverview
23+
* @suppress {missingRequire}
24+
*/
2125
(function (global) {
2226
// Detect and setup WTF.
2327
var wtfTrace = null;

dist/zone-bluebird.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ Zone.__load_patch('bluebird', function (global, Zone, api) {
2424
// global.Promise is not Bluebird, and Bluebird is just be
2525
// used by other libraries such as sequelize, so I think it is
2626
// safe to just expose a method to patch Bluebird explicitly
27-
Zone[Zone.__symbol__('bluebird')] = function patchBluebird(Bluebird) {
27+
var BLUEBIRD = 'bluebird';
28+
Zone[Zone.__symbol__(BLUEBIRD)] = function patchBluebird(Bluebird) {
2829
Bluebird.setScheduler(function (fn) {
29-
Zone.current.scheduleMicroTask('bluebird', fn);
30+
Zone.current.scheduleMicroTask(BLUEBIRD, fn);
3031
});
3132
};
3233
});

dist/zone-bluebird.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/zone-error.js

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
* Use of this source code is governed by an MIT-style license that can be
1919
* found in the LICENSE file at https://angular.io/license
2020
*/
21+
/**
22+
* @fileoverview
23+
* @suppress {globalThis,undefinedVars}
24+
*/
2125
Zone.__load_patch('Error', function (global, Zone, api) {
2226
/*
2327
* This code patches Error so that:
@@ -88,9 +92,10 @@ Zone.__load_patch('Error', function (global, Zone, api) {
8892
// We got called with a `new` operator AND we are subclass of ZoneAwareError
8993
// in that case we have to copy all of our properties to `this`.
9094
Object.keys(error).concat('stack', 'message').forEach(function (key) {
91-
if (error[key] !== undefined) {
95+
var value = error[key];
96+
if (value !== undefined) {
9297
try {
93-
_this[key] = error[key];
98+
_this[key] = value;
9499
}
95100
catch (e) {
96101
// ignore the assignment in case it is a setter and it throws.
@@ -145,6 +150,7 @@ Zone.__load_patch('Error', function (global, Zone, api) {
145150
}
146151
});
147152
}
153+
var ZONE_CAPTURESTACKTRACE = 'zoneCaptureStackTrace';
148154
Object.defineProperty(ZoneAwareError, 'prepareStackTrace', {
149155
get: function () {
150156
return NativeError.prepareStackTrace;
@@ -159,7 +165,7 @@ Zone.__load_patch('Error', function (global, Zone, api) {
159165
for (var i = 0; i < structuredStackTrace.length; i++) {
160166
var st = structuredStackTrace[i];
161167
// remove the first function which name is zoneCaptureStackTrace
162-
if (st.getFunctionName() === 'zoneCaptureStackTrace') {
168+
if (st.getFunctionName() === ZONE_CAPTURESTACKTRACE) {
163169
structuredStackTrace.splice(i, 1);
164170
break;
165171
}
@@ -173,6 +179,14 @@ Zone.__load_patch('Error', function (global, Zone, api) {
173179
// run/runGuarded/runTask frames. This is done by creating a detect zone and then threading
174180
// the execution through all of the above methods so that we can look at the stack trace and
175181
// find the frames of interest.
182+
var ZONE_AWARE_ERROR = 'ZoneAwareError';
183+
var ERROR_DOT = 'Error.';
184+
var EMPTY = '';
185+
var RUN_GUARDED = 'runGuarded';
186+
var RUN_TASK = 'runTask';
187+
var RUN = 'run';
188+
var BRACKETS = '(';
189+
var AT = '@';
176190
var detectZone = Zone.current.fork({
177191
name: 'detect',
178192
onHandleError: function (parentZD, current, target, error) {
@@ -191,20 +205,20 @@ Zone.__load_patch('Error', function (global, Zone, api) {
191205
// Chrome: at Zone.run (http://localhost:9876/base/build/lib/zone.js:100:24)
192206
// FireFox: Zone.prototype.run@http://localhost:9876/base/build/lib/zone.js:101:24
193207
// Safari: run@http://localhost:9876/base/build/lib/zone.js:101:24
194-
var fnName = frame.split('(')[0].split('@')[0];
208+
var fnName = frame.split(BRACKETS)[0].split(AT)[0];
195209
var frameType = 1;
196-
if (fnName.indexOf('ZoneAwareError') !== -1) {
210+
if (fnName.indexOf(ZONE_AWARE_ERROR) !== -1) {
197211
zoneAwareFrame1 = frame;
198-
zoneAwareFrame2 = frame.replace('Error.', '');
212+
zoneAwareFrame2 = frame.replace(ERROR_DOT, EMPTY);
199213
blackListedStackFrames[zoneAwareFrame2] = 0 /* blackList */;
200214
}
201-
if (fnName.indexOf('runGuarded') !== -1) {
215+
if (fnName.indexOf(RUN_GUARDED) !== -1) {
202216
runGuardedFrame = true;
203217
}
204-
else if (fnName.indexOf('runTask') !== -1) {
218+
else if (fnName.indexOf(RUN_TASK) !== -1) {
205219
runTaskFrame = true;
206220
}
207-
else if (fnName.indexOf('run') !== -1) {
221+
else if (fnName.indexOf(RUN) !== -1) {
208222
runFrame = true;
209223
}
210224
else {

0 commit comments

Comments
 (0)