Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Upgrade to TypeScript 3.7 #5562

Merged
merged 2 commits into from Mar 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/Coverage.js
Expand Up @@ -137,7 +137,7 @@ class JSCoverage {
async stop() {
assert(this._enabled, 'JSCoverage is not enabled');
this._enabled = false;
const [profileResponse] = await Promise.all([
const result = await Promise.all([
this._client.send('Profiler.takePreciseCoverage'),
this._client.send('Profiler.stopPreciseCoverage'),
this._client.send('Profiler.disable'),
Expand All @@ -146,6 +146,7 @@ class JSCoverage {
helper.removeEventListeners(this._eventListeners);

const coverage = [];
const profileResponse = /** @type Protocol.Profiler.takePreciseCoverageReturnValue */ (result[0]);
for (const entry of profileResponse.result) {
let url = this._scriptURLs.get(entry.scriptId);
if (!url && this._reportAnonymousScripts)
Expand Down
4 changes: 3 additions & 1 deletion lib/FrameManager.js
Expand Up @@ -56,10 +56,12 @@ class FrameManager extends EventEmitter {
}

async initialize() {
const [,{frameTree}] = await Promise.all([
const result = await Promise.all([
this._client.send('Page.enable'),
this._client.send('Page.getFrameTree'),
]);

const {frameTree} = /** @type Protocol.Page.getFrameTreeReturnValue*/ (result[1]);
this._handleFrameTree(frameTree);
await Promise.all([
this._client.send('Page.setLifecycleEventsEnabled', { enabled: true }),
Expand Down
4 changes: 0 additions & 4 deletions lib/WebSocketTransport.js
Expand Up @@ -30,10 +30,6 @@ class WebSocketTransport {
maxPayload: 256 * 1024 * 1024, // 256Mb
});

/* error that WebSocket is not assignable to type WebSocket
* due to a misisng dispatchEvent() method which the ws library
* does not implement and we do not need
*/
ws.addEventListener('open', () => resolve(new WebSocketTransport(ws)));
ws.addEventListener('error', reject);
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -61,7 +61,7 @@
"pixelmatch": "^4.0.2",
"pngjs": "^3.3.3",
"text-diff": "^1.0.1",
"typescript": "3.6.5"
"typescript": "3.7.5"
},
"browser": {
"./lib/BrowserFetcher.js": false,
Expand Down
2 changes: 1 addition & 1 deletion utils/doclint/check_public_api/JSBuilder.js
Expand Up @@ -160,7 +160,7 @@ function checkSources(sources) {
properties.push(...innerType.properties);
innerTypeNames.push(innerType.name);
}
if (innerTypeNames.length === 1 && innerTypeNames[0] === 'void')
if (innerTypeNames.length === 0 || innerTypeNames.length === 1 && innerTypeNames[0] === 'void')
return new Documentation.Type(type.symbol.name);
return new Documentation.Type(`${type.symbol.name}<${innerTypeNames.join(', ')}>`, properties);
}
Expand Down