Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Change the AST structure #3

@eredo

Description

@eredo

The AST generated from the .d.ts file containing the closure types is not optimal. It's using an object map structure where properties are directly added into the object. Instead it should contain arrays for these properties.

Currently:

{
  qualifiedName: 'TestModule.TestClass',
  kind: NodeKind.CLASS
  staticMethod: {
    kind: NodeKind.FUNCTION,
    qualifiedName: 'TestModule.TestClass.staticMethod'
  },
  '#': {
    method: {
      kind: NodeKind.FUNCTION,
      qualifiedName: 'TestModule.TestClass.prototype.method'
    }
  }
}

Proposal:

{
  qualifiedName: 'TestModule.TestClass',
  kind: NodeKind.CLASS
  statics: [{
    name: 'staticMethod',
    kind: NodeKind.FUNCTION,
    qualifiedName: 'TestModule.TestClass.staticMethod'
  }],
  members: [{
    name: 'method',
    kind: NodeKind.FUNCTION,
    qualifiedName: 'TestModule.TestClass.prototype.method'
  }]
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions