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

Use webworker typings for webServer.ts #46944

Merged
merged 1 commit into from
Feb 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions src/tsserver/webServer.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
/*@internal*/
namespace ts.server {
declare const addEventListener: any;
declare const postMessage: any;
declare const close: any;
declare const location: any;
declare const XMLHttpRequest: any;
declare const self: any;

/// <reference lib="webworker" />

namespace ts.server {
const nullLogger: Logger = {
close: noop,
hasLevel: returnFalse,
Expand Down Expand Up @@ -86,7 +82,7 @@ namespace ts.server {
}

function hrtime(previous?: [number, number]) {
const now = self.performance.now(performance) * 1e-3;
const now = self.performance.now() * 1e-3;
let seconds = Math.floor(now);
let nanoseconds = Math.floor((now % 1) * 1e9);
if (previous) {
Expand All @@ -109,7 +105,7 @@ namespace ts.server {
exit() {
this.logger.info("Exiting...");
this.projectService.closeLog();
close(0);
close();
}

listen() {
Expand Down