Skip to content

Incorrect type definition for ExtendedAttributeRightHandSideIdentifierList #818

@pyoor

Description

@pyoor

I filed this here instead of DefinitelyTyped because I suspect it's an issue with how extended attributes are being parsed.

When parsing the following WebIDL:

interface AbortSignal : EventTarget {
  [Exposed=(Window,Worker), NewObject, Throws]
  static AbortSignal timeout([EnforceRange] unsigned long long milliseconds);
}

The type definition defines:

export interface ExtendedAttributeRightHandSideIdentifier {
  type: "identifier"
  value: string
}

export interface ExtendedAttributeRightHandSideIdentifierList {
  type: "identifier-list"
  value: ExtendedAttributeRightHandSideIdentifier[]
}

However, the resulting AST is:

{
  "type": "extended-attribute",
  "name": "Exposed",
  "rhs": {
    "type": "identifier-list",
    "value": [
      {
        "value": "Window"
      },
      {
        "value": "Worker"
      }
    ]
  },
  "arguments": []
}

I suspect for consistency sake, these value entries should be of type identifier?

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