Skip to content

Commit 469afe8

Browse files
authored
fix(config): make sure that Promise config is undefined initially (#3440)
We need to make sure promise is undefined initially because systems like Zones need to have a chance to pick up Promise and patch it, and we're doing a runtime check for configuration anyhow. This makes the runtime check worthwhile and solves the problem with Zones (without needing to reference Zones in anyway)
1 parent 7873f8a commit 469afe8

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

spec/config-spec.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { config } from '../src/internal/config';
2+
import { expect } from 'chai';
3+
4+
describe('config', () => {
5+
it('should have a Promise property that defaults to nothing', () => {
6+
expect(config).to.have.property('Promise');
7+
expect(config.Promise).to.be.undefined;
8+
});
9+
});

src/internal/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ export const config = {
77
* The promise constructor used by default for methods such as
88
* {@link toPromise} and {@link forEach}
99
*/
10-
Promise
10+
Promise: undefined as PromiseConstructorLike
1111
};

0 commit comments

Comments
 (0)