Skip to content

Commit

Permalink
fix(zone.js): work around TS3.7 issue
Browse files Browse the repository at this point in the history
In TypeScript 3.7, circularity detection misfires on the declaration of `value` here.
microsoft/TypeScript#32950

Declaring an explicit type avoids the problem.
  • Loading branch information
mprobst committed Oct 25, 2019
1 parent 7a280b1 commit 585ea89
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/zone.js/lib/zone-spec/wtf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@
const out: {[k: string]: any} = {};
for (const key in obj) {
if (obj.hasOwnProperty(key)) {
let value = obj[key];
// explicit : any due to https://github.com/microsoft/TypeScript/issues/33191
let value: any = obj[key];
switch (typeof value) {
case 'object':
const name = value && value.constructor && (<any>value.constructor).name;
Expand Down

0 comments on commit 585ea89

Please sign in to comment.