Skip to content

Restore name of second argument to FileReader.readAsText #105

Closed
@blixt

Description

@blixt

In eaf8fd9 ("Cleaned up wrong TOC"), arangana made a change from readAsText(blob[, encoding]) to readAsText(blob[, label]) but I have not been able to find a motivation.

I'm proposing that the name encoding is brought back in order to clarify what the parameter does, without having to read the surrounding text in the spec.

My main motivation for filing this issue is that some documentation generators depend on the wording in this spec, which trickles down an arguably poor parameter name choice to all developers using the DOM APIs. (See microsoft/TypeScript-DOM-lib-generator#536).

The reasoning for encoding specifically is:

  1. It's the parameter name that had already been settled on in the spec from 2009–2013
  2. It's still used by respected documentation sources (eg., MDN)
  3. It's arguably the most concise description of what the valid input values are (eg., "UTF-8")

Here is what today's documentation looks like in Visual Studio Code (TypeScript) due to the name choice in this repository:

screen shot 2018-07-21 at 12 55 53

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions