-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
microsoft/TypeScript-DOM-lib-generator
#703Labels
BugA bug in TypeScriptA bug in TypeScriptNeeds More InfoThe issue still hasn't been fully clarifiedThe issue still hasn't been fully clarified
Milestone
Description
TypeScript Version: 3.5.0-rc
Search Terms:
Worker MessagePort postMessage
Code
let worker: Worker;
worker.postMessage("test");
let port: MessagePort;
port.postMessage("test");
let either: MessagePort | Worker;
either.postMessage("test"); // error TS2554: Expected 2 arguments, but got 1.Expected behavior:
No error. There is no error in 3.4. I'm not sure if this is a bug in the compiler or due to the changes to MessagePort.postMessage in lib.dom.d.ts. Should Worker.postMessage also be updated to have the optional options parameter?
Reference: https://html.spec.whatwg.org/multipage/workers.html#dedicated-workers-and-the-worker-interface
Actual behavior:
error TS2554: Expected 2 arguments, but got 1.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptNeeds More InfoThe issue still hasn't been fully clarifiedThe issue still hasn't been fully clarified