Thanks to visit codestin.com
Credit goes to github.com

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

Commit c555b08

Browse files
JiaLiPassionvikerman
authored andcommitted
build: release zone.js 0.9.1
1 parent 10e1b0c commit c555b08

17 files changed

+429
-245
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
<a name="0.9.1"></a>
2+
## [0.9.1](https://github.com/angular/zone.js/compare/v0.9.0...0.9.1) (2019-04-30)
3+
4+
5+
### Bug Fixes
6+
7+
* ensure that EventTarget is patched prior to legacy property descriptor patch ([#1214](https://github.com/angular/zone.js/issues/1214)) ([aca4728](https://github.com/angular/zone.js/commit/aca4728))
8+
* fakeAsyncTest requestAnimationFrame should pass timestamp as parameter ([#1220](https://github.com/angular/zone.js/issues/1220)) ([62b8525](https://github.com/angular/zone.js/commit/62b8525)), closes [#1216](https://github.com/angular/zone.js/issues/1216)
9+
10+
11+
### Features
12+
13+
* add option to disable jasmine clock patch, also rename the flag of auto jump in FakeAsyncTest ([#1222](https://github.com/angular/zone.js/issues/1222)) ([10e1b0c](https://github.com/angular/zone.js/commit/10e1b0c))
14+
15+
16+
117
<a name="0.9.0"></a>
218
# [0.9.0](https://github.com/angular/zone.js/compare/v0.8.29...0.9.0) (2019-03-12)
319

dist/fake-async-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ var __spread = (undefined && undefined.__spread) || function () {
145145
if (doTick) {
146146
doTick(this._currentTime - lastCurrentTime);
147147
}
148-
var retval = current_1.func.apply(global, current_1.args);
148+
var retval = current_1.func.apply(global, current_1.isRequestAnimationFrame ? [this._currentTime] : current_1.args);
149149
if (!retval) {
150150
// Uncaught exception in the current scheduled function. Stop processing the queue.
151151
break;

dist/jasmine-patch.js

Lines changed: 50 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,13 @@
5151
var syncZone = ambientZone.fork(new SyncTestZoneSpec('jasmine.describe'));
5252
var symbol = Zone.__symbol__;
5353
// whether patch jasmine clock when in fakeAsync
54-
var enableClockPatch = _global[symbol('fakeAsyncPatchLock')] === true;
54+
var disablePatchingJasmineClock = _global[symbol('fakeAsyncDisablePatchingClock')] === true;
55+
// the original variable name fakeAsyncPatchLock is not accurate, so the name will be
56+
// fakeAsyncAutoFakeAsyncWhenClockPatched and if this enablePatchingJasmineClock is false, we also
57+
// automatically disable the auto jump into fakeAsync feature
58+
var enableAutoFakeAsyncWhenClockPatched = !disablePatchingJasmineClock &&
59+
((_global[symbol('fakeAsyncPatchLock')] === true) ||
60+
(_global[symbol('fakeAsyncAutoFakeAsyncWhenClockPatched')] === true));
5561
var ignoreUnhandledRejection = _global[symbol('ignoreUnhandledRejection')] === true;
5662
if (!ignoreUnhandledRejection) {
5763
var globalErrors_1 = jasmine.GlobalErrors;
@@ -100,48 +106,50 @@
100106
return originalJasmineFn.apply(this, arguments);
101107
};
102108
});
103-
// need to patch jasmine.clock().mockDate and jasmine.clock().tick() so
104-
// they can work properly in FakeAsyncTest
105-
var originalClockFn = (jasmine[symbol('clock')] = jasmine['clock']);
106-
jasmine['clock'] = function () {
107-
var clock = originalClockFn.apply(this, arguments);
108-
if (!clock[symbol('patched')]) {
109-
clock[symbol('patched')] = symbol('patched');
110-
var originalTick_1 = (clock[symbol('tick')] = clock.tick);
111-
clock.tick = function () {
112-
var fakeAsyncZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');
113-
if (fakeAsyncZoneSpec) {
114-
return fakeAsyncZoneSpec.tick.apply(fakeAsyncZoneSpec, arguments);
115-
}
116-
return originalTick_1.apply(this, arguments);
117-
};
118-
var originalMockDate_1 = (clock[symbol('mockDate')] = clock.mockDate);
119-
clock.mockDate = function () {
120-
var fakeAsyncZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');
121-
if (fakeAsyncZoneSpec) {
122-
var dateTime = arguments.length > 0 ? arguments[0] : new Date();
123-
return fakeAsyncZoneSpec.setCurrentRealTime.apply(fakeAsyncZoneSpec, dateTime && typeof dateTime.getTime === 'function' ? [dateTime.getTime()] :
124-
arguments);
109+
if (!disablePatchingJasmineClock) {
110+
// need to patch jasmine.clock().mockDate and jasmine.clock().tick() so
111+
// they can work properly in FakeAsyncTest
112+
var originalClockFn_1 = (jasmine[symbol('clock')] = jasmine['clock']);
113+
jasmine['clock'] = function () {
114+
var clock = originalClockFn_1.apply(this, arguments);
115+
if (!clock[symbol('patched')]) {
116+
clock[symbol('patched')] = symbol('patched');
117+
var originalTick_1 = (clock[symbol('tick')] = clock.tick);
118+
clock.tick = function () {
119+
var fakeAsyncZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');
120+
if (fakeAsyncZoneSpec) {
121+
return fakeAsyncZoneSpec.tick.apply(fakeAsyncZoneSpec, arguments);
122+
}
123+
return originalTick_1.apply(this, arguments);
124+
};
125+
var originalMockDate_1 = (clock[symbol('mockDate')] = clock.mockDate);
126+
clock.mockDate = function () {
127+
var fakeAsyncZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');
128+
if (fakeAsyncZoneSpec) {
129+
var dateTime = arguments.length > 0 ? arguments[0] : new Date();
130+
return fakeAsyncZoneSpec.setCurrentRealTime.apply(fakeAsyncZoneSpec, dateTime && typeof dateTime.getTime === 'function' ? [dateTime.getTime()] :
131+
arguments);
132+
}
133+
return originalMockDate_1.apply(this, arguments);
134+
};
135+
// for auto go into fakeAsync feature, we need the flag to enable it
136+
if (enableAutoFakeAsyncWhenClockPatched) {
137+
['install', 'uninstall'].forEach(function (methodName) {
138+
var originalClockFn = (clock[symbol(methodName)] = clock[methodName]);
139+
clock[methodName] = function () {
140+
var FakeAsyncTestZoneSpec = Zone['FakeAsyncTestZoneSpec'];
141+
if (FakeAsyncTestZoneSpec) {
142+
jasmine[symbol('clockInstalled')] = 'install' === methodName;
143+
return;
144+
}
145+
return originalClockFn.apply(this, arguments);
146+
};
147+
});
125148
}
126-
return originalMockDate_1.apply(this, arguments);
127-
};
128-
// for auto go into fakeAsync feature, we need the flag to enable it
129-
if (enableClockPatch) {
130-
['install', 'uninstall'].forEach(function (methodName) {
131-
var originalClockFn = (clock[symbol(methodName)] = clock[methodName]);
132-
clock[methodName] = function () {
133-
var FakeAsyncTestZoneSpec = Zone['FakeAsyncTestZoneSpec'];
134-
if (FakeAsyncTestZoneSpec) {
135-
jasmine[symbol('clockInstalled')] = 'install' === methodName;
136-
return;
137-
}
138-
return originalClockFn.apply(this, arguments);
139-
};
140-
});
141149
}
142-
}
143-
return clock;
144-
};
150+
return clock;
151+
};
152+
}
145153
/**
146154
* Gets a function wrapping the body of a Jasmine `describe` block to execute in a
147155
* synchronous-only zone.
@@ -155,7 +163,7 @@
155163
var isClockInstalled = !!jasmine[symbol('clockInstalled')];
156164
var testProxyZoneSpec = queueRunner.testProxyZoneSpec;
157165
var testProxyZone = queueRunner.testProxyZone;
158-
if (isClockInstalled && enableClockPatch) {
166+
if (isClockInstalled && enableAutoFakeAsyncWhenClockPatched) {
159167
// auto run a fakeAsync
160168
var fakeAsyncModule = Zone[Zone.__symbol__('fakeAsyncTest')];
161169
if (fakeAsyncModule && typeof fakeAsyncModule.fakeAsync === 'function') {

dist/jasmine-patch.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.

0 commit comments

Comments
 (0)