Skip to content

Regression in dom.lib.d.ts: TS complains about FileReader's result #25510

Closed
microsoft/TypeScript-DOM-lib-generator
#704
@vvs

Description

@vvs

TypeScript Version: 3.0.0-dev.20180707

Search Terms: dom, FileReader

Code

Taken directly from MDN: https://developer.mozilla.org/en-US/docs/Web/API/FileReader/onload

function onChange(event) {
    var file = event.target.files[0];
    var reader = new FileReader();
    reader.onload = function(event) {
      // The file's text will be printed here
      console.log(event.target.result)
    };
  
    reader.readAsText(file);
  }

Expected behavior:
No errors.

Actual behavior:
[ts] Property 'result' does not exist on type 'EventTarget'.


This is a regression, since there were no such errors reported in TS 2.9.2.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptNeeds InvestigationThis issue needs a team member to investigate its status.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions