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

Commit 2a8415d

Browse files
authored
fix: closure related fixes (#1206)
These fixes are needed to make Zone compile with closure with advanced optimizations.
1 parent 47dd3f4 commit 2a8415d

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

lib/common/fetch.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
* Use of this source code is governed by an MIT-style license that can be
66
* found in the LICENSE file at https://angular.io/license
77
*/
8+
/**
9+
* @fileoverview
10+
* @suppress {missingRequire}
11+
*/
812

913
Zone.__load_patch('fetch', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
1014
interface FetchTaskData extends TaskData {

lib/zone-spec/long-stack-trace.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ function renderLongStackTrace(frames: LongStackTrace[], stack?: string): string
113113
// Fix issue https://github.com/angular/zone.js/issues/1195,
114114
// For event task of browser, by default, all task will share a
115115
// singleton instance of data object, we should create a new one here
116-
task.data = {...task.data};
116+
117+
// The cast to `any` is required to workaround a closure bug which wrongly applies
118+
// URL sanitization rules to .data access.
119+
(task.data as any) = {...(task.data as any)};
117120
}
118121
(task.data as any)[creationTrace] = trace;
119122
}

0 commit comments

Comments
 (0)