mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
We must read `Symbol.species` safely because `this` may be anything. For instance, `this` may be an object without a prototype (created through `Object.create(null)`); thus `this.constructor` will be undefined. One of the use cases is SystemJS creating prototype-less objects (modules) via `Object.create(null)`. The SystemJS creates an empty object and copies promise properties into that object (within the `getOrCreateLoad` function). The zone.js then checks if the resolved value has the `then` method and invokes it with the `value` context. Otherwise, this will throw an error: `TypeError: Cannot read properties of undefined (reading 'Symbol(Symbol.species)')`. PR Close #45369 |
||
|---|---|---|
| .. | ||
| Error.spec.ts | ||
| fetch.spec.ts | ||
| microtasks.spec.ts | ||
| promise-disable-wrap-uncaught-promise-rejection.spec.ts | ||
| Promise.spec.ts | ||
| setInterval.spec.ts | ||
| setTimeout.spec.ts | ||
| task.spec.ts | ||
| toString.spec.ts | ||
| util.spec.ts | ||
| zone.spec.ts | ||