GeezerVison is showing github.com — fix(zone.js): harden zoneSymbolEventNames and patches against __proto… · angular/angular@2d33fd5
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: packages/zone.js/lib/common/utils.ts +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -129,7 +129,8 @@ export const isMix: boolean = | 129 | 129 | !isWebWorker && | 130 | 130 | !!(isWindowExists && internalWindow['HTMLElement']); | 131 | 131 |
| 132 | | -const zoneSymbolEventNames: {[eventName: string]: string} = {}; | | 132 | +// tslint:disable-next-line:no-toplevel-property-access | | 133 | +const zoneSymbolEventNames: {[eventName: string]: string} = Object.create(null); | 133 | 134 |
| 134 | 135 | const enableBeforeunloadSymbol = zoneSymbol('enable_beforeunload'); | 135 | 136 |
| |
Collapse file Copy file name to clipboardExpand all lines: packages/zone.js/lib/zone-impl.ts +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -814,7 +814,7 @@ export function initZone(): ZoneType { | 814 | 814 | } | 815 | 815 |
| 816 | 816 | static __load_patch(name: string, fn: PatchFn, ignoreDuplicate = false): void { | 817 | | - if (patches.hasOwnProperty(name)) { | | 817 | + if (Object.hasOwn(patches, name)) { | 818 | 818 | // `checkDuplicate` option is defined from global variable | 819 | 819 | // so it works for all modules. | 820 | 820 | // `ignoreDuplicate` can work for the specified module | @@ -1601,7 +1601,7 @@ export function initZone(): ZoneType { | 1601 | 1601 | macroTask: 'macroTask' = 'macroTask', | 1602 | 1602 | eventTask: 'eventTask' = 'eventTask'; | 1603 | 1603 |
| 1604 | | - const patches: {[key: string]: any} = {}; | | 1604 | + const patches: {[key: string]: any} = Object.create(null); | 1605 | 1605 | const _api: ZonePrivate = { | 1606 | 1606 | symbol: __symbol__, | 1607 | 1607 | currentZoneFrame: () => _currentZoneFrame, | |
Collapse file Copy file name to clipboardExpand all lines: packages/zone.js/test/typings/tsconfig.json +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 13 | 13 | "noEmitOnError": false, | 14 | 14 | "stripInternal": false, | 15 | 15 | "strict": true, | 16 | | - "lib": ["es5", "dom", "es2015.collection", "es2015.iterable", "es2015.promise"] | | 16 | + "lib": ["es5", "dom", "es2015.collection", "es2015.iterable", "es2015.promise", "es2022.object"] | 17 | 17 | }, | 18 | 18 | "files": ["./type.test.ts", "./node_modules/zone.js/zone.ts"] | 19 | 19 | } |
Collapse file Copy file name to clipboardExpand all lines: packages/zone.js/tsconfig.json +4-3Lines changed: 4 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 18 | 18 | "es2015.iterable", | 19 | 19 | "es2015.promise", | 20 | 20 | "es2015.symbol", | 21 | | - "es2015.symbol.wellknown" | 22 | | - ], | 23 | | - }, | | 21 | + "es2015.symbol.wellknown", | | 22 | + "es2022.object" | | 23 | + ] | | 24 | + } | 24 | 25 | } |
|