X Tutup
Skip to content

Commit 94272af

Browse files
committed
chore: update zone.js to 0.5.1
fix angular#1862
1 parent ad95601 commit 94272af

File tree

6 files changed

+13
-17
lines changed

6 files changed

+13
-17
lines changed

karma-js.conf.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ module.exports = function(config) {
1313
// zone-microtask must be included first as it contains a Promise monkey patch
1414
'node_modules/zone.js/dist/zone-microtask.js',
1515
'node_modules/zone.js/dist/long-stack-trace-zone.js',
16+
'node_modules/zone.js/dist/jasmine-patch.js',
1617

1718
'node_modules/traceur/bin/traceur-runtime.js',
1819
'node_modules/es6-module-loader/dist/es6-module-loader-sans-promises.src.js',

modules/angular2/src/test_lib/fake_async.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@ interface FakeAsyncZone extends NgZoneZone {
2525
* @returns {Function} The function wrapped to be executed in the fakeAsync zone
2626
*/
2727
export function fakeAsync(fn: Function): Function {
28-
// TODO(vicb) re-enable once the jasmine patch from zone.js is applied
29-
// if (global.zone._inFakeAsyncZone) {
30-
// throw new Error('fakeAsync() calls can not be nested');
31-
//}
28+
if ((<FakeAsyncZone>global.zone)._inFakeAsyncZone) {
29+
throw new Error('fakeAsync() calls can not be nested');
30+
}
3231

3332
var fakeAsyncZone = <FakeAsyncZone>global.zone.fork({
3433
setTimeout: _setTimeout,

modules/angular2/test/test_lib/fake_async_spec.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,10 @@ export function main() {
3737
it('should work with inject()',
3838
inject([Parser], fakeAsync((parser) => { expect(parser).toBeAnInstanceOf(Parser); })));
3939

40-
if (!IS_DARTIUM) {
41-
it('should throw on nested calls', () => {
42-
// TODO(vicb): re-enable once the jasmine patch from zone.js is applied
43-
if (!IS_DARTIUM) return;
44-
expect(() => { fakeAsync(() => { fakeAsync(() => null)(); })(); })
45-
.toThrowError('fakeAsync() calls can not be nested');
46-
});
47-
}
40+
it('should throw on nested calls', () => {
41+
expect(() => { fakeAsync(() => { fakeAsync(() => null)(); })(); })
42+
.toThrowError('fakeAsync() calls can not be nested');
43+
});
4844

4945
it('should flush microtasks before returning', () => {
5046
var thenRan = false;

npm-shrinkwrap.clean.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9567,7 +9567,7 @@
95679567
}
95689568
},
95699569
"zone.js": {
9570-
"version": "0.5.0"
9570+
"version": "0.5.1"
95719571
}
95729572
},
95739573
"name": "angular",

npm-shrinkwrap.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"systemjs": "^0.9.1",
3939
"traceur": "0.0.87",
4040
"which": "~1",
41-
"zone.js": "0.5.0"
41+
"zone.js": "0.5.1"
4242
},
4343
"devDependencies": {
4444
"angular": "1.3.5",

0 commit comments

Comments
 (0)
X Tutup