GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(zone.js): harden zoneSymbolEventNames and patches against __proto… · angular/angular@2d33fd5

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/zone.js
    • lib
      • common
        • utils.ts
      • zone-impl.ts
    • test/typings
      • tsconfig.json
    • tsconfig.json
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/zone.js/lib/common/utils.ts‎

Copy file name to clipboardExpand all lines: packages/zone.js/lib/common/utils.ts
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ export const isMix: boolean =
129129
!isWebWorker &&
130130
!!(isWindowExists && internalWindow['HTMLElement']);
131131

132-
const zoneSymbolEventNames: {[eventName: string]: string} = {};
132+
// tslint:disable-next-line:no-toplevel-property-access
133+
const zoneSymbolEventNames: {[eventName: string]: string} = Object.create(null);
133134

134135
const enableBeforeunloadSymbol = zoneSymbol('enable_beforeunload');
135136

Collapse file

‎packages/zone.js/lib/zone-impl.ts‎

Copy file name to clipboardExpand all lines: packages/zone.js/lib/zone-impl.ts
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ export function initZone(): ZoneType {
814814
}
815815

816816
static __load_patch(name: string, fn: PatchFn, ignoreDuplicate = false): void {
817-
if (patches.hasOwnProperty(name)) {
817+
if (Object.hasOwn(patches, name)) {
818818
// `checkDuplicate` option is defined from global variable
819819
// so it works for all modules.
820820
// `ignoreDuplicate` can work for the specified module
@@ -1601,7 +1601,7 @@ export function initZone(): ZoneType {
16011601
macroTask: 'macroTask' = 'macroTask',
16021602
eventTask: 'eventTask' = 'eventTask';
16031603

1604-
const patches: {[key: string]: any} = {};
1604+
const patches: {[key: string]: any} = Object.create(null);
16051605
const _api: ZonePrivate = {
16061606
symbol: __symbol__,
16071607
currentZoneFrame: () => _currentZoneFrame,
Collapse file

‎packages/zone.js/test/typings/tsconfig.json‎

Copy file name to clipboardExpand all lines: packages/zone.js/test/typings/tsconfig.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"noEmitOnError": false,
1414
"stripInternal": false,
1515
"strict": true,
16-
"lib": ["es5", "dom", "es2015.collection", "es2015.iterable", "es2015.promise"]
16+
"lib": ["es5", "dom", "es2015.collection", "es2015.iterable", "es2015.promise", "es2022.object"]
1717
},
1818
"files": ["./type.test.ts", "./node_modules/zone.js/zone.ts"]
1919
}
Collapse file

‎packages/zone.js/tsconfig.json‎

Copy file name to clipboardExpand all lines: packages/zone.js/tsconfig.json
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"es2015.iterable",
1919
"es2015.promise",
2020
"es2015.symbol",
21-
"es2015.symbol.wellknown"
22-
],
23-
},
21+
"es2015.symbol.wellknown",
22+
"es2022.object"
23+
]
24+
}
2425
}

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.