Skip to content
This repository has been archived by the owner on Jan 9, 2019. It is now read-only.

Improve initialization of utils-debugging-protocol-common #44

Closed
antross opened this issue Oct 5, 2018 · 0 comments
Closed

Improve initialization of utils-debugging-protocol-common #44

antross opened this issue Oct 5, 2018 · 0 comments
Assignees

Comments

@antross
Copy link
Member

antross commented Oct 5, 2018

Currently debugging-protocol-connector.ts contains a number of properties which are asynchronously initialized after the CDP connection has been established. As the code is migrated to TypeScript's strict mode, each of these properties is considered potentially uninitialized when read within methods. The spot fix is to override the compiler's assertion for now.

Going forward, this would be better handled by taking all of these late-initialized properties and putting them within a single (initially null) sub-object. This provides a single point at which null-checks can be performed in dependent methods without having to check each property individually. It also allows the TypeScript compiler to understand that this check has taken place.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants